P
PengYu.UT
Hi,
I have some problem when I use enum with stream. The code segment is
listed below. I know if I change the first line to "int op;", there
will not be any error. However, what I really want is of enum type. Is
there any other way to fix this problem?
Best wishes,
Peng
rect_type op;// int op;
ss >> op;//std::istringstream ss; compile time error
//with the declaration of
enum rect_type{
CANONICAL,
TOP_LEFT,
BOTTOM_LEFT,
TOP_RIGHT,
BOTTOM_RIGHT,
TOP_MIDDLE,
BOTTOM_MIDDLE,
LEFT_MIDDLE,
RIGHT_MIDDLE,
CENTRAL
};
I have some problem when I use enum with stream. The code segment is
listed below. I know if I change the first line to "int op;", there
will not be any error. However, what I really want is of enum type. Is
there any other way to fix this problem?
Best wishes,
Peng
rect_type op;// int op;
ss >> op;//std::istringstream ss; compile time error
//with the declaration of
enum rect_type{
CANONICAL,
TOP_LEFT,
BOTTOM_LEFT,
TOP_RIGHT,
BOTTOM_RIGHT,
TOP_MIDDLE,
BOTTOM_MIDDLE,
LEFT_MIDDLE,
RIGHT_MIDDLE,
CENTRAL
};