Microcontroller › 8051 › what does these warnings mean???? › i think you have used SWITCH
March 4, 2012 at 4:20 pm
#7246
phanindra nath
Participant
i think you have used SWITCH as follows-
switch(n)
{
case v1: statements;
case v2: statements;
case v3: statements;
case vn: statements;
default:
}
did you write code like above code?
if so then its WRONG because CASE identifiers should be CONSTANTs .
you cannot write “case v1” because ‘v1’ is a variable.
instead you can write as
……
case 11: statements;
case 12: statements;
…….
i hope you understand.
if you havesome time please check my blog