Why enum can not be used directly with printf function?

Answers were Sorted based on User's Feedback



Why enum can not be used directly with printf function?..

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

Why enum can not be used directly with printf function?..

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

Why enum can not be used directly with printf function?..

Answer / srinivas

it is DAta type name like int so it can not be in printf

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More Data Structures Interview Questions

Explain what are the major data structures used in the hierarchical data model?

0 Answers  


Define hashing?

0 Answers  


What is the best case for bubble sort?

0 Answers  


Mention for which header list, you will found the last node contains the null pointer?

0 Answers  


Advanced problems related to Data Structures were asked

0 Answers   Motorola,






Define depth and height of a tree?

0 Answers  


What is impact of signed numbers on the memory using data structures?

0 Answers  


Why linked lists are better than arrays?

0 Answers  


What is heap tree in data structure?

0 Answers  


What is collision in data structure?

0 Answers  


What do you mean by articulation point?

0 Answers  


In depth questions regarding the data structures and the Databases used in the Projects developed.

0 Answers   Motorola,


Categories