void flip ( int i ) { assert( i==1 && i==0); if(i = 1) i=0; else i=0; } int main() { int i = 1; assert(i==1); flip(i); assert(i==0); flip(i); assert(i==1); cout << "Success!\n"; return 0; }
assert( i==1 && i==0); // Why &&. I think this should be || if(i = 1) i=0; else i=0; // Here you will have to set i = 1 (assuming this is what flip function is supposed to do
if(i=1)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)