c++ - What is the meaning of : "int i, (!!i)"? -
we have following c++ code:
int i; (!!i);
what operation on variable i?
i've seen done prevent warnings "warning, variable unused".
after odd !!i
statement, variable (technically) used in expression, warning suppressed, didn't change anything.
example:
void myfunc() { int i; (!!i); // suppress warning caused block below. #if debug // in retail / non-debug code, not used, , warning created!! = getcountofsomething(); printf("the count of %d\n", i); #endif // debug }
Comments
Post a Comment