Do they yield the same result or different?
1.
1 2
|
bool tf; int n;
if(1) tf = true, n=2; //plz explain this.. tf=true,
|
2.
1 2 3
|
bool tf; int n;
if(1) {tf = true; n=2;}
|
Last edited on
They are the same, but you should prefer the second.
You may want to look up the boolean datatype.
How can a comma(,) be used after tf=true