Try changing your case statements to:

case ONE:

case TWO:



[email protected] wrote:
> 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/
> ]http://in.messenger.yahoo.com/webmessengerpromo.php/ 
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> 
>  
> 
> 



To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/c-prog/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/c-prog/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to