Switch (C#)

Morpheus

Well-known member
Joined
Jan 18, 2002
Messages
62
I have some problems with a nestled switch loop.

Im trying to do something like this.

C#:
string selection = menu();

switch(selection)
{
    case "customer":
    {
           <someCode>
    }

     case "supplier":
     {
          string subSelection = Convert.ToString(Console.ReadLine());
           switch(subSelection)
           {
               case <someString>
               {

and so on...

This doesnt work.

Any ideas?
 
do you put break statement in the end of each case?

C#:
switch( a )
{
   case 0:
       //do something
       break;
   case 1:
       //do something else
       break;
}

also what exactly doesnt work? it doesnt compile or is there another problem?
 
Back
Top