Hi,
Please help me to understand what really happens in the below code.
[code=c]
#define num 20
main()
{
printf("%d,",nu m);
func();
printf("%d",num );
}
void func()
{
#undef num
#define num 50
}
[/code]
The output is 20,20.
I expect the output to be 20,50
It seems to be strange to understand. Help me
Thanks in advance,
Chella
Please help me to understand what really happens in the below code.
[code=c]
#define num 20
main()
{
printf("%d,",nu m);
func();
printf("%d",num );
}
void func()
{
#undef num
#define num 50
}
[/code]
The output is 20,20.
I expect the output to be 20,50
It seems to be strange to understand. Help me
Thanks in advance,
Chella
Comment