3 ms·
In C++17 not only can you do assignment in the conditional, you can declare new variables which have the scope of the then and else clauses. But yes, most comp
by gumby 9y ago
In C++17 not only can you do assignment in the conditional, you can declare new variables which have the scope of the then and else clauses.
But yes, most compilers will catch this case.
- gowld 9y agoThe compiler warns unless you add an extra () around the assignment to signal that you mean it.