R
raghu
Hello Everyone,
I am using macro functions in my project the code is
working correctly, But I have a doubt wheather the macro functions
creates a context switching as in the case of normal functions. For
example see the code below:
#define funct(dest, src) {\
for( i = 0; i< 10; i++ )\
dest += (src + i);\
}
main()
{
int i, k;
funct(k , 10);
printf(" %d", k);
}
In this case 'int i' was not declared in funct but it works. And if in
main() 'int i' was not declared and declared in funct defination also
it works. Is there any context switch happening.
Thanks in advance
Bye
Raghu
I am using macro functions in my project the code is
working correctly, But I have a doubt wheather the macro functions
creates a context switching as in the case of normal functions. For
example see the code below:
#define funct(dest, src) {\
for( i = 0; i< 10; i++ )\
dest += (src + i);\
}
main()
{
int i, k;
funct(k , 10);
printf(" %d", k);
}
In this case 'int i' was not declared in funct but it works. And if in
main() 'int i' was not declared and declared in funct defination also
it works. Is there any context switch happening.
Thanks in advance
Bye
Raghu