Created
January 31, 2024 00:23
-
-
Save certik/888e098241049ee941b0cf5efbe93722 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
#define REPEAT(count, action) REPEAT_HELPER(count, action) | |
#define REPEAT_HELPER(count, action) \ | |
REPEAT_##count(action) | |
#define REPEAT_1(action) action(1) | |
#define REPEAT_2(action) action(2) REPEAT_1(action) | |
#define REPEAT_3(action) action(3) REPEAT_2(action) | |
#define PRINT_NUMBER(x) printf("%d\n", x); | |
REPEAT(3, PRINT_NUMBER) | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment