Jim Pantera

enum identifiers in a switch case

Discussion created by Jim Pantera on Aug 25, 2006
Latest reply on Aug 29, 2006 by Jim Pantera
the case of a switch expression having an enum type and the case expressions include the identifiers which are looked up as enum constants in the enum type does not build proper.
produces and error c1815 & c1845.


//from three different files code segmants
my_varriable.c
enum myenum {xx,yy,zz} MyEnum;

my_varriable.h
extern enum myenum MyEnum;

main.c
#include my_varriable.h
switch(MyEnum){
case xx:
case yy:
case zz:
};

Outcomes