Why the below program throughs error during compilation?
#include<stdio.h>
#include<conio.h>
enum
{
ZERO,
ONE,
TWO,
};
main()
{
printf("%d",&TWO);
getch();
}
Answers were Sorted based on User's Feedback
Answer / vadivelt
Since memory shall not be allocated for an enum variable,
accessing address of the same is not possible.
ie.,
Below line is invalid, cos u r trying to access the address
of a constant.
printf("%d",&TWO);
Hence the error.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / modassir alam
TWO or any enum variable not hold memory address hence error
| Is This Answer Correct ? | 2 Yes | 1 No |
What is structure in c language?
Explain what is the concatenation operator?
Explain what is output redirection?
matrix multiplication fails introspect the causes for its failure and write down the possible reasons for its failurein c language.
what is c programming?
int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);
here is a link to download Let_Us_C_-_Yashwant_Kanetkar
Can you write a programmer for FACTORIAL using recursion?
Explain how do you convert strings to numbers in c?
Explain about the constants which help in debugging?
what is structuer?
To what value are pointers initialized? 1) NULL 2) Newly allocated memory 3) No action is taken by the compiler to initialize pointers.