Skip to content

Instantly share code, notes, and snippets.

@kokosabu
Created September 8, 2014 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kokosabu/e7fdf9fa21fcf4dcae80 to your computer and use it in GitHub Desktop.
Save kokosabu/e7fdf9fa21fcf4dcae80 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define each(S,E,V,Func) \
do { \
for(int V = (S); V <= (E); V++) { \
Func\
} \
}while(0)
int main()
{
each(1,100,v,{printf("%d\n",v);});
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment