#define f(x)
main()
{
printf("\n%d",f(2+2));
}
Answers were Sorted based on User's Feedback
Answer / g.j.hemalatha
f(x) is an identifier.No constants is defined in the macro
definition.So the answer is a garbage value.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / priyadarshan kasta
it will show a error message as expression syntax error
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / civa
Compiler Error "error: syntax error before ')' token"
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / 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 |
What is the best way to store flag values in a program?
How can you dynamically allocate memory in C?
Why does not use getgh(); and <conio.h> in c language.
12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV
void main() { int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} }; int (*p)[2]; int i,j,*pint; for(i=0;i<=3;i++) { p=&s[i]; pint=p; printf("\n"); for(j=0;j<=1;j++) printf("%d",*(pint+j)); } } while running this program it shows a warning-suspicious pointer conversion ie pint=p; my que is why should we assign the value of p to pint again.why cant we use it directly as *(p+j)..but if i use like tat the o/p is garbage value..
Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.
why Language C is plateform dependent
difference of two no's with out using - operator
what is the difference between NULL('\0') and 0?
In c language can we compile a program without main() function?
write a c program to accept a given integer value and print its value in words
4 Answers Vernalis, Vernalis Systems,
difference between function & structure