C Programming - Structures, Unions, Enums - Discussion
Discussion Forum : Structures, Unions, Enums - Yes / No Questions (Q.No. 6)
6.
Is there easy way to print enumeration values symbolically?
Answer: Option
Explanation:
You can write a function of your own to map an enumeration constant to a string.
Discussion:
4 comments Page 1 of 1.
Bhargavi said:
8 years ago
Please, anyone explain in detail.
Rits said:
8 years ago
We can't it directly. Their is no inbuilt function for it.
Mounica said:
8 years ago
Any example how to do it?
Sunil pandey said:
1 decade ago
Well, No. You can write a little function (one per enumeration) to map an enumeration constant to a string, either by using a switch statement or by searching an array. (For debugging purposes, a good debugger should automatically print enumeration constants symbolically).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers