do {…} while(0) In Macros Pattern | C Programming Tutorial
5K views on YouTube
An explanation of why the do {…} while(0) pattern is used in function-like macros in C. Source code: https://github.com/portfoliocourses/c-example-code/blob/main/do_while_0_macro_pattern.c. Check out https://www.portfoliocourses.com to build a portfolio that will impress employers!
Pattern Explanation: https://bruceblinn.com/linuxinfo/DoWhile.html
Stackoverflow Explanation: https://stackoverflow.com/a/9496007