A push in the right direction please.
-
The question states. Write the following code and discuss what exactly results. enum logical { no, maybe, yes }; I get the enum part, no = 0, maybe = 1 and yes = 2. But what is the 'logical' part? A logical |, or perhaps a logical & Thanks for a push in the right direction.
-
The question states. Write the following code and discuss what exactly results. enum logical { no, maybe, yes }; I get the enum part, no = 0, maybe = 1 and yes = 2. But what is the 'logical' part? A logical |, or perhaps a logical & Thanks for a push in the right direction.
McGahanFL wrote: But what is the 'logical' part? It's the name of the set (i.e., type). As an added bonus, how would your answer change, if at all, if I were to change the statement to:
enum logical { no, maybe = 3, yes };
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
McGahanFL wrote: But what is the 'logical' part? It's the name of the set (i.e., type). As an added bonus, how would your answer change, if at all, if I were to change the statement to:
enum logical { no, maybe = 3, yes };
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
Are you saying I can replace the word 'logical' with types like int or CString? I don't think that is what you mean. bonus question no = 0, maybe =3, yes = 4 ------------------------- logical operator &&(logical a, logical b); thansk
McGahanFL wrote: Are you saying I can replace the word 'logical' with types like int or CString? No, not at all. The word following the
enum
keyword is the name of your new type, like animal, position, or vehicle. McGahanFL wrote: bonus question no = 0, maybe =3, yes = 4 Very good. You have a firm grasp on the subject.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
McGahanFL wrote: Are you saying I can replace the word 'logical' with types like int or CString? No, not at all. The word following the
enum
keyword is the name of your new type, like animal, position, or vehicle. McGahanFL wrote: bonus question no = 0, maybe =3, yes = 4 Very good. You have a firm grasp on the subject.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen