bool status = true;
//---------------
//doesn't work:
if (CONDITION)
{
status != status;
}
//---------------
//does work:
if (CONDITION)
{
if (status)
{
status = false;
}
else
{
status = true;
}
}
Thanks for an explanation (especially about why the first won't work).
...only slightly less clear. I like to use whitespace for clarity, even if it is something small like that. No big deal really, though; both compile and do the same thing.