"clino" <zh**********@gmail.comwrote:
const int c=9;
void main()
<http://c-faq.com/ansi/maindecl.html>
<http://c-faq.com/ansi/voidmain.html>
<http://c-faq.com/ansi/voidmain3.html>
<http://c-faq.com/ansi/voidmainbooks.html>
{
int a=9;
switch (a)
{
case c:
a=c+1;
break;
}
}
-----------
compile result:
c.c(8) : error C2051: case expression not constant
-----------
But [c] is a const int....why?
<http://c-faq.com/cpp/constvsdefine.html>
<http://c-faq.com/ansi/constasconst.html>
HTH; HAND; RTFFAQ.
Richard