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 fieldsMatt Loschert10 Apr
  • Re: rounding/truncation of decimal fieldsgerald_clark11 Apr
RE: rounding/truncation of decimal fieldsClifton R [CC] Jones11 Apr
  • Re: rounding/truncation of decimal fieldsgerald_clark11 Apr
    • Re: rounding/truncation of decimal fieldsMatt Loschert11 Apr
      • Re: rounding/truncation of decimal fieldsDoug Thompson11 Apr
        • Re: rounding/truncation of decimal fieldsMatt Loschert12 Apr
          • Re: rounding/truncation of decimal fieldsDoug Thompson12 Apr
            • More on enumMartin Gainty12 Apr
            • Re: rounding/truncation of decimal fieldsMatt Loschert13 Apr
              • Re: rounding/truncation of decimal fieldsDoug Thompson13 Apr
              • Re: rounding/truncation of decimal fieldsDan Nelson13 Apr
                • Re: rounding/truncation of decimal fieldsMatt Loschert14 Apr
Re: rounding/truncation of decimal fieldsMoon79611 Apr