Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



Why the below program throughs error during compilation? #include<stdio.h> #include<con..

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

Why the below program throughs error during compilation? #include<stdio.h> #include<con..

Answer / modassir alam

TWO or any enum variable not hold memory address hence error

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

What is the difference between functions getch() and getche()?

0 Answers  


how write a addtion of two single dimensional array using of pointer in c language?

3 Answers   DRDO,


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

0 Answers   TCS,


int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?

15 Answers   Mascot,


What is meaning of "Void main" in C Language.

24 Answers   Ford, GU, HCL, IBIBS, JUW, TCS,


what is compiler

7 Answers  


What does == mean in texting?

0 Answers  


const char * char * const What is the differnce between the above tow?.

6 Answers   Ramco, TCS,


What does a run-time "null pointer assignment" error mean?

2 Answers  


What does c in a circle mean?

0 Answers  


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

0 Answers   Celstream,


Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….

1 Answers  


Categories