Tuesday, 15 March 2016

Use enum to define a type called Response with the possible values Yes, No, and Maybe. Yes should be 1, No should be 0, and Maybe should be 2.

Leave a Comment

Question:

Use enum to define a type called Response with the possible values Yes, No, and Maybe. Yes should be 1, No should be 0, and Maybe should be 2.

Answer:

enum Response {No, Yes, Maybe};

Source:

C++ Primer Plus Sixth Edition Chapter Review

If You Enjoyed This, Take 5 Seconds To Share It