4 ms·
Whats up with the do/while loops? Does that just make the return syntactically valid? Apologies, its been a while since I've touched C/C++
by davydog187 8y ago
Whats up with the do/while loops? Does that just make the return syntactically valid?
Apologies, its been a while since I've touched C/C++
- pdexter 8y agohttps://stackoverflow.com/questions/154136/why-use-apparently-meaningless-do-while-and-if-else-statements-in-macros https://stackoverflow.com/questions/154136/why-use-apparentl...
- tom_ 8y agoThis is dealt with at the bottom of the article. It's a C FAQ: http://c-faq.com/cpp/multistmt.html http://c-faq.com/cpp/multistmt.html
- okl 8y agoGCC has an extension that can be used instead of the do-while loop, see example macro definition here: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html