Two interesting C questions

| Friday, September 18, 2009
1. Whats wrong with this code?
int a,b,c;
int *p;
a=100;
c=10;
p=&c;
b=a/*p;
printf("%d",b);


2. Why is the following code not wrong?
int a,b,c;
int *p;
http://www.google.com/
a=100;
c=10;
p=&c;
b=a/ *p;
printf("%d",b);


Answer:
1. /* starts the comment
2. http: is label, // starts the comment

0 comments:

Post a Comment

Random Posts

Powered by Stuff-a-Blog