Essentially what I'm trying do with nested statements is that when I enter the the second switch stament and when I exit the second switch statement it goes back to the first switch statement menu.
Currently the current code exits the entire program after the second switch exits, which of course was not the plan.
#include <stdlib.h>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char** argv) {
int ch1,ch2,tmp;
while(1)
{
cout<<endl<<endl;
cout<<" Menu "<<endl;
cout<<" ----------------------------- "<<endl;
cout<<" 1. Select Directory "<<endl;
cout<<" 4. Exit "<<endl;
cout<<" Enter your choice : ";
cin>>ch1;
switch(ch1)
{
case 1 :{
while(1) {
cout<<" Directory Selection"<<endl;
cout<<" 1. Computing Science "<<endl;
cout<<" Enter your choice : ";
cin>>ch2;
switch(ch2){
case 1 : break;
case 4:
return 0;
break;
}
}
}
case 4:
return 0;
break;
}
}
return (EXIT_SUCCESS);
}