#define f(x)
main()
{
printf("\n%d",f(2+2));
}

Answer Posted / suman halder

within printf statement,f(2+2) i.e f(4) must return a value so that this value could get printed through %d format specifier..
Now,as f(x) is a macro template and macro expansion code for this template is not specified..so,here the situation is like,we are trying to return an integer value from a function which is having a "void" return type..
so,compiler flashes "Expression syntax error"..as during preprocessing macro template can't be replaced by macro expansion...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is "Duff's Device"?

704


Explain what is page thrashing?

613


Is malloc memset faster than calloc?

622


What are keywords c?

607


What are integer variable, floating-point variable and character variable?

611






What standard functions are available to manipulate strings?

567


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

672


What is the significance of c program algorithms?

685


What do you understand by normalization of pointers?

629


How can I implement sets or arrays of bits?

609


How can I convert a number to a string?

611


What are types of functions?

571


what is the difference between class and unio?

1866


What is wrong with this statement? Myname = 'robin';

828


What is the full form of getch?

587