Just tried it with visual studio express... it does work.
try it yourself
Code:
// test2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#define for(a) printf("start loop\n"); for(a,printf("in loop\n"))
int _tmain(int argc, _TCHAR* argv[])
{
int i;
int y;
y= 0;
for (i=0; i < 10; i++)
{
y++;
}
return(0);
}
Now as for lite-c try this
Code:
#define for(a) diag("start for"); bad code to cause compile error if this is expanded for(a,diag("loop"))
void foo(int i)
{
int y;
y = 1;
for (i=0;i<100;i++)
{
wait(1);
}
}