Created
October 5, 2012 19:53
-
-
Save whyrusleeping/3841982 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 DO(n) for(int i = 0; i < n; i++) | |
int main() | |
{ | |
int arr[10]; | |
DO(10) | |
arr[i] = 2 * i; | |
DO(10) | |
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
My hackery https://gist.github.com/3842749