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
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
What is c++ used for today?
How many main () function we can have in a project?
Why is it usually a bad idea to use gets()? Suggest a workaround.
What is a string?
What does the characters “r” and “w” mean when writing programs that will make use of files?
Are pointers integers in c?
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
Can you please explain the difference between syntax vs logical error?
Explain what does it mean when a pointer is used in an if statement?
Define Array of pointers.
FILE PROGRAMMING
Why flag is used in c?
How can you read a directory in a C program?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function