Why enum can not be used directly with printf function?
Answers were Sorted based on User's Feedback
Answer / rashmi p
enum is not an basic data type like int,float and all it is
a user defined data type, and printf function works only
with basic data type, we 've overload printf function to
make it work for user defined data types :)
| Is This Answer Correct ? | 21 Yes | 2 No |
Answer / sudip
main()
{
enum color{
red,black,green,yellow,blue,pink,white
};
printf("%d",green);
printf("%d",yellow);
}
this gives me output.... 23
we can use it....?/ Correct me if I am wrong...
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / srinivas
it is DAta type name like int so it can not be in printf
| Is This Answer Correct ? | 5 Yes | 3 No |
What is adt example?
What is structure of data type?
Does the minimal spanning tree of a graph give the shortest distance between any 2 specified nodes?
What are arrays used for?
What is nonlinear data?
How do you sort an arraylist in descending order?
How do you declare An array of three char pointers
What is the main advantage of a linked list?
Is char array null terminated?
Is boolean a data type?
Why is concurrenthashmap thread safe?
Two linked lists are given, find out the sum of them without altering the linked list?