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

Define function pointers?

1 Answers  


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

0 Answers   Celstream,


WAP to accept first name,middle name & last name of a student display its initials?

5 Answers   AITH, NIIT,


wats SIZE_T meant for?

1 Answers  


what are the different storage classes in c?

0 Answers   TCS,


1.What is a Data Structure? Explain its need? 2.What is a Directed Graph? Write an algorithm to find whether a Directed Graph is connected or not? 3.Explain the process of converting a Tree to a Binary Tree.

4 Answers   Ignou, TCS,


What is the function of volatile in c language?

0 Answers  


What are the types of variables in c?

0 Answers  


how to copy a string without using c function

5 Answers  


WHAT IS HEADER?

8 Answers   ProKarma, TCS,


Explain how do you list a file’s date and time?

0 Answers  


What is the difference between typeof(foo) and myFoo.GetType()?

2 Answers   Synergy,


Categories