What is the output for the program given below
typedef enum errorType{warning, error,
exception,}error;
main()
{
error g1;
g1=1;
printf("%d",g1);
}
Answer / susie
Answer :
Compiler error: Multiple declaration for error
Explanation
The name error is used in the two meanings. One means
that it is a enumerator constant with value 1. The another
use is that it is a type name (due to typedef) for enum
errorType. Given a situation the compiler cannot distinguish
the meaning of error to know in what sense the error is used:
error g1;
g1=error;
// which error it refers in each case?
When the compiler can distinguish between usages then
it will not issue error (in pure technical terms, names can
only be overloaded in different namespaces).
Note: the extra comma in the declaration,
enum errorType{warning, error, exception,}
is not an error. An extra comma is valid and is provided
just for programmer’s convenience.
Is This Answer Correct ? | 6 Yes | 0 No |
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped
write a simple calculator c program to perform addition, subtraction, mul and div.
0 Answers United Healthcare, Virtusa,
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,
What is your nationality?
main() { int a[10]; printf("%d",*a+1-*a+3); }
#include<stdio.h> int main() { int x=2,y; y=++x*x++*++x; printf("%d",y); } Output for this program is 64. can you explain how this output is come??
What is the main difference between STRUCTURE and UNION?
main() { int i=400,j=300; printf("%d..%d"); }
Cau u say the output....?
how to concatenate the two strings
main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
what is the code of the output of print the 10 fibonacci number series