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 the difference between functions getch() and getche()?
how write a addtion of two single dimensional array using of pointer in c language?
Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
What is meaning of "Void main" in C Language.
24 Answers Ford, GU, HCL, IBIBS, JUW, TCS,
what is compiler
What does == mean in texting?
const char * char * const What is the differnce between the above tow?.
What does a run-time "null pointer assignment" error mean?
What does c in a circle mean?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….