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();
}

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what will be the output for the following main() { printf("hi" "hello"); }

11151


Why do we use & in c?

1047


What is difference between && and & in c?

1152


What is context in c?

975


What is the ANSI C Standard?

1327


What is the deal on sprintf_s return value?

1183


What is string constants?

1197


What is the method to save data in stack data structure type?

1141


Can you write the function prototype, definition and mention the other requirements.

1195


Explain what are the different file extensions involved when programming in c?

1155


Explain the difference between #include "..." And #include <...> In c?

1084


What does != Mean in c?

1091


Is it better to use malloc() or calloc()?

1171


What are the types of pointers in c?

1078


Explain what is wrong in this statement?

1173