Understanding the Use of do…while(0) in C Language Macros
In verification, when using the C language construct case, macros are often utilized. Sometimes, you may see a #define that wraps a piece of code with do…while(0), even though it only executes once. Why use do…while(0 and what is its purpose? The C language uses macros to implement a function: defining two integer variables x … Read more