Quote:Original post by Robo-Link
basicly you could just say the rest of the code is
int main()
{
int black = 0;
change();
cout << black;
change();
cout << black;
return 0;
}
Immediately, I can see why C++ is always saying black is always zero. I'm actually surprised your compiler hasn't give you a warning in your change function.
If you read up on C++ basics, all of the following will work:
The if test someone posted
black = black ? 0 : 1;
black = black ^ 1;