| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Martin Gainty | Date: | April 12 2003 9:59pm |
| Subject: | More on enum | ||
| View as plain text | |||
Here is a test app on enums
#include <stdio.h>
int main(int argc,char *argv)
{
enum pitchers {Clemens=21, Palmer=22, Ryan=34};
enum quarterbacks {Staubach=0,Starr=1};
enum status {bad = 0, good = 1};
enum status s;
s:1;
enum pitchers p, p1;
enum quarterbacks q;
//causes main.cpp(7) : error C2513: 'main::pitchers' : decl-specifier is
missing a declarator before '='
//in other words you cannot assign 2 different enums to each other
p = q;
p1 = p;
return (0);
}
Assign one enum to DIFFERENT enum is an ERROR
Assigning a enum variable one of the permitted values is allowed
Assigning a enum variable to another variable of same enum declaration is
permissible
| Thread | ||
|---|---|---|
| • rounding/truncation of decimal fields | Matt Loschert | 10 Apr |
| • Re: rounding/truncation of decimal fields | gerald_clark | 11 Apr |
| • RE: rounding/truncation of decimal fields | Clifton R [CC] Jones | 11 Apr |
| • Re: rounding/truncation of decimal fields | gerald_clark | 11 Apr |
| • Re: rounding/truncation of decimal fields | Matt Loschert | 11 Apr |
| • Re: rounding/truncation of decimal fields | Doug Thompson | 11 Apr |
| • Re: rounding/truncation of decimal fields | Matt Loschert | 12 Apr |
| • Re: rounding/truncation of decimal fields | Doug Thompson | 12 Apr |
| • More on enum | Martin Gainty | 12 Apr |
| • Re: rounding/truncation of decimal fields | Matt Loschert | 13 Apr |
| • Re: rounding/truncation of decimal fields | Doug Thompson | 13 Apr |
| • Re: rounding/truncation of decimal fields | Dan Nelson | 13 Apr |
| • Re: rounding/truncation of decimal fields | Matt Loschert | 14 Apr |
| • Re: rounding/truncation of decimal fields | Moon796 | 11 Apr |
