3 ms·
would that work? #define while(x) for(;true;)
by Akronymus 5y ago
would that work?
#define while(x) for(;true;)
- layer8 5y agoIt would cause a compile error for do-while loops. And there’s no reason to use `for` here, `while (true)` would do the same (C macros don’t expand recursively in such cases).
- Akronymus 5y agoI guess i would go with this in a header file that includes rand.h instead, then: #define while(cond) while ((cond) && rand() >= somesufficientlysmallnumber)