also you are binding your pointer to a temporary object, you need to allocate some memory if you need to manipulate it later.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
bool* newData = false; newData points to a temporal object
void setBoolean(bool* newData)
{
if (true)
*newData = true;/// this would lead to a segvault
}
///allocate some memory
bool* newData =newbool(false);
void setBoolean(bool* newData)
{
if ( true)
*newData = true;///a valid operation
}
andy1992's declaration
///allocate some memory
bool* newData =new bool(false);
seems to have fixed it. I can't actually tell yet, there is some more development to do, but it compiles okay.