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

How can I manipulate individual bits?

1043


Who developed c language?

1097


Why do we use c for the speed of light?

1213


What are the types of pointers?

1117


What are keywords in c with examples?

1089


What are the advantages of Macro over function?

2025


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1159


What is difference between array and pointer in c?

1091


What is volatile, register definition in C

1109


Explain union. What are its advantages?

1081


Explain how many levels deep can include files be nested?

1077


Write a program to swap two numbers without using third variable in c?

1133


Explain how do you declare an array that will hold more than 64kb of data?

1455


Explain what is the benefit of using an enum rather than a #define constant?

1223


What is the significance of an algorithm to C programming?

1046