Can someone explain this to me plz...
Ok I have tried to use the 'case and switch' thing in a program and I can't get it to work for one thing but that isn't all too important, what is important is that I would like someone with some time on their hands to explain how it works...
I know it goes something(don't yell if not even close ;))
Code:
int a,b,c,d;
switch(d)
{
case 'a'
{whatever}
case 'b'
{whatever}
case 'c'
{whatever}
I completely realize that isn't close but what I am confused about is how you check the thing in brackets after switch to the things in brackets with the cases. If I wanted the program to say take in user input, place it in d, and then go to each of the cases and match it(like if it was 1 then do case a or whatever)but I dont' know how it checks that out...do I have to define what a b c are ahead of time for it to work?
Thanks in advance and once again sorry bout the sloppy example.