Q
qianz99
Hello I define a sequence of const
typedef struct
{
int year;
int month;
}birth
const birth a={1990,1};
const birth b={1990,2};
......
Now I'd like to use switch in my main function
I have
switch(test)
{
case a.month: ...
case b.month: ...
...
}
but the compiler says :
case label does not reduce to an integer constant
What should I do?
I don't want to use if.
Thanks a lot!
typedef struct
{
int year;
int month;
}birth
const birth a={1990,1};
const birth b={1990,2};
......
Now I'd like to use switch in my main function
I have
switch(test)
{
case a.month: ...
case b.month: ...
...
}
but the compiler says :
case label does not reduce to an integer constant
What should I do?
I don't want to use if.
Thanks a lot!