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

Bit swapping

2 Answers  


Explain About fork()?

0 Answers   TISL,


how to find the largest element of array without using relational operater?

6 Answers   Satyam, Wipro,


Explain that why C is procedural?

0 Answers   Maveric, Verifone,


main() { char *p; p="Hello"; printf("%c\n",*&*p); }

2 Answers   ME,


What is include directive in c?

0 Answers  


The file stdio.h, what does it contain?

0 Answers  


How many parameters should a function have?

0 Answers  


What are static functions?

1 Answers  


What is the difference between printf and scanf in c?

0 Answers  


write a program that finds the factorial of a number using recursion?

13 Answers   Infosys, TATA,


what type of questions arrive in interview over c programming?

0 Answers  


Categories