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

Explain the priority queues?

0 Answers  


What is New modifiers?

0 Answers   NA,


What is use of pointer?

0 Answers  


What is the size of array float a(10)?

0 Answers  


How to delete a node from linked list w/o using collectons?

0 Answers   Zycus Infotech,


write a own function to compare two strings with out using stringcomparition function?

6 Answers   LG Soft, Sasken,


What is getch?

0 Answers  


Are global variables static in c?

0 Answers  


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

0 Answers  


What is putchar() function?

0 Answers  


write a program to gat the digt sum of a number (et. 15= >1+5=6)

2 Answers  


What should malloc(0) do?

0 Answers  


Categories