Here is my code:
int main() {
static int test = 0;
const int anotherInt = 1;
test = anotherInt > test ? test++ : 0;
if (anotherInt > test)
test++;
else
test = 0;
return 0;
}
Here the warning appears when I create it:
../main.cpp:15:40: warning: operation on βtestβ may be undefined [-Wsequence-point]
test= anotherInt>test ? test++ : 0;
^
Why does C ++ give me a warning about triple operation, but is not a regular expression if..else?
source
share