Which of the following is correct A. static enum num{ON, OFF} B. static const enum num{ON, OFF} C. const enum num{ON, OFF} D. None

This question is related to Wipro Interview

Showing Answers 1 - 10 of 10 Answers

Arun

  • Jan 31st, 2006
 

i checked with turboc. Static is not allowed with enum but const is.so it is option C

  Was this answer useful?  Yes

richa

  • Apr 25th, 2007
 

i think d is correct because we haven't put semicolon in any statement.

  Was this answer useful?  Yes

kummyvv

  • Jul 17th, 2007
 

arun, none of the above are correct. either static or const is not allowed as they are allowed only for objcets & functions not for enumarators, as far as I know.
well semicolon is not there, its valid point though, but we are just checking symantic checks NOT syntax checks, since the question has not started with #include and main function.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions