I am using a Switch Case in my program, but I can't make it working! The program I am making is just for practise and it will be a calculator when finished. The problem with my Switch Case is that the Switch variable(input) is not an integer. It is a char.
It's value depends on what the user inputs.(A, B, C or D)
I have used a ELSE IF statement earlier in the code but I am not sure if it has any effect on the working of the Switch Case.
It is difficult to explain this, so have a look at the code:
switch (input, 2, '\n')
case (!strcmpi("A", input))
do z=x+y //this is where the compiler gives a bug report
case: (!strcmpi("B", input))
case: (!strcmpi("C", input))
case: (!strcmpi("D", input))
I will not display the entire program here, but I know I am doing something terribly wrong.. I am sure I have included the right header files, and all the used variables exist. Ever time when I try to compile the compiler says that there is a Parse error before DO.
Please someone tell me what I am doing wrong, the tutorial is not clear enough on Switch Case