-
-
Save travisperson/3842749 to your computer and use it in GitHub Desktop.
My favorite Pre-processor hackery
This file contains hidden or 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> | |
#define to ; i <= | |
#define DO(range) for(int range; i++) | |
int main() | |
{ | |
int arr[10]; | |
DO(i = 0 to 9) | |
arr[i] = 2 * i; | |
DO(i = 0 to 9) | |
printf("%d\n", arr[i]); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment