I'm new to C++, and I'm still stuck on pointers. Somewhat. The little that I know, would this be possible? I want to send 'Running' to the function "UTIL_CrashProgram" and have that function set 'Running' to false.
File: UTIL.h
#ifndef _INCLUDE_H_UTIL
#define _INCLUDE_H_UTIL
// Basic error function
void UTIL_CrashProgram( const char *Reason, bool Dump2File = false, bool *SendRunningBoolHere = true );
#endif
File: Main.cpp
int main( int argc, char* args[] )
{
// Crash it
UTIL_CrashProgram("Failed",false,Running);
return 0;
}
And last:
File: Util.cpp
#include "CUtil.h"
void UTIL_CrashProgram( const char Reason, bool Dump2File, bool *SendRunningBoolHere )
{
SendRunningBoolHere = false;
}
But when I compile, i get the error:
1>c:\users\drak\desktop\editing\mygreatgamev1\mygreatgamev1\cutil.h(11) : error C2548: 'UTIL_CrashProgram' : missing default parameter for parameter 3
1>c:\users\drak\desktop\editing\mygreatgamev1\mygreatgamev1\cmain.cpp(14) : error C2664: 'UTIL_CrashProgram' : cannot convert parameter 3 from 'bool' to 'bool *'