#include<stdio.h>
#define FUN(arg) do\
{\
if(arg)\
printf("Have fun...","\n");\
}while(i--)
void main()
{
int i=2;
FUN(i<3);
}
How thit programme giving o/p "Have fun...Have fun...Have fun..."
can any one help me please.
#include<stdio.h>
#define FUN(arg) do\
{\
if(arg)\
printf("Have fun...","\n");\
}while(i--)
void main()
{
int i=2;
FUN(i<3);
}
How thit programme giving o/p "Have fun...Have fun...Have fun..."
can any one help me please.
Perform the function-style macro expansion yourself and then examine the resulting program.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
hi thanks 4 ur suggestion laserlight ?
if u know the ans please answer?
What exactly do you not understand? The use of a function-style macro? The loop itself?Originally Posted by pin2
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I think you should probably perform the function-style macro expansion yourself and then examine the resulting program.
Quzah.
Hope is the first step on the road to disappointment.
Do you understand how the below program works?
Well, that's all what the function-style macro expansion does (colored part)Code:#include<stdio.h> void main() { int i=2; do { if(i<3) printf("Have fun...","\n"); }while(i--); }
Last edited by technam; 12-24-2009 at 12:56 AM. Reason: grammar correction