Hello Sirs,
I have read in K&R's C Programming and was trying for implementing token
concatenation as follows:
#define ONE 1
#define TWO 2
int main()
{
int i;
printf("\nEnter the number\n");
scanf("%d",&i);
switch(i)
{
case(##ONE):
printf("\nONE");
break;
case(##TWO):
printf("\nTWO");
break;
default:
printf("\nDefault\n");
}
system("PAUSE");
return 0;
}
But it is giving syntax error in whichever line I am using the ##.
Can anyone help me in rectifying this error.
With Regards,
Debasish
Karmennevaya Dhikaraste, Maaphaaleshu Kadaachanah
Did you know? You can CHAT without downloading messenger. Go to
http://in.messenger.yahoo.com/webmessengerpromo.php/
[Non-text portions of this message have been removed]