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
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 |
Answer / modassir alam
TWO or any enum variable not hold memory address hence error
Is This Answer Correct ? | 2 Yes | 1 No |
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
2 Answers HCL, IBM, Satyam, Vimal, Vimukti Technologies,
how to find the largest element of array without using relational operater?
1) int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); a++; }while(a!=0); return 0; } can anyone please explain the explain the output
Is a pointer a kind of array?
what is difference between #include<stdio.h> and #include"stdio.h"
How can I read data from data files with particular formats?
What are identifiers in c?
#include<stdio.h> void main() { int =1; printf("%d%d%d",a++,++a,++a); }
Program to write some contents into a file using file operations with proper error messages.
what is an array
Is the C language is the portable language...If yes...Then Why...and if not then what is problem so it is not a Portable language..???
Do you have any idea about the use of "auto" keyword?