|
INTERVIEW QUESTIONS
C
FILE OPERATIONS IN C
DETAILS
Question: What is the benefit of using an enum rather than a #define constant?
Answer: The use of an enumeration constant (enum) has many advantages over using the traditional symbolic constant style of #define. These advantages include a lower maintenance requirement, improved program readability, and better debugging capability. The first advantage is that enumerated constants are generated automatically by the compiler. Conversely, symbolic constants must be manually assigned values by the programmer. For instance, if you had an enumerated constant type for error codes that could occur in your program.
|
|
|
Category |
File Operations in C Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9244 users |
Added on |
9/18/2014 |
Views |
66369 |
Rate it! |
|
|
Question:
What is the benefit of using an enum rather than a #define constant?
Answer:
The use of an enumeration constant (enum) has many advantages over using the traditional symbolic constant style of #define. These advantages include a lower maintenance requirement, improved program readability, and better debugging capability. The first advantage is that enumerated constants are generated automatically by the compiler. Conversely, symbolic constants must be manually assigned values by the programmer. For instance, if you had an enumerated constant type for error codes that could occur in your program. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Can include files be nested?
|
View Answer
|
|
Can include files be nested?
|
View Answer
|
|
read a A file aaaaabbbbb.. and read a B file 111112222... in c file to write aaaaa11111bbbbb22222 like this?
|
View Answer
|
|
how to merge to file in c?
|
View Answer
|
|
Write a program for creating your own header file and library function?
|
View Answer
|
|
What is File Mode?. Types Of file mode?. What is Pointer?. which one is most useful in Structure or Unoin?.
|
View Answer
|
|
How can we read/write structures from/to data files?
|
View Answer
|
|
1.WAP find the largest of 4 no using macros 2.WAP read a line from file from location N1 to N2 using command line agruments Eg:exe 10 20 a.c
|
View Answer
|
|
If we develop a project in C, then how can we create an exe file of it?
|
View Answer
|
|
How do you redirect a standard stream?
|
View Answer
|
|
How can you restore a redirected standard stream?
|
View Answer
|
|
What is the difference between text and binary modes?
|
View Answer
|
|
How can I open a file so that other programs can update it at the same time?
|
View Answer
|
|
How can I make sure that my program is the only one accessing a file?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All File Operations in C Interview Questions & Answers - Exam Mode /
Learning Mode
|