This isn't that useful, but it works.
If you need to initialze a variable in a for loop, you can call a custom loop, like this:
Code:
#define loop(i,j,k) i##;for(;j;k)
...
loop(int i = 0, i < n, i++) { ... }
Another one, this one is a really cool one. This one I use a lot of the time.
An easy way to loop through linked lists.
Code:
#define lListLoop(list, node) for(node = list.start; node != NULL; node = node->next)
...
lListLoop(MyLinkedList, node)
{
i = node->data;
...
}
PS: Thanks guys