Switch (C#)

Morpheus

Regular
Joined
Jan 18, 2002
Messages
62
I have some problems with a nestled switch loop.

I'm 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 doesn't 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 doesn't work? it doesn't compile or is there another problem?
 
Back
Top