Switch case

i need my switch case menu to select an option then after it has finished it, it will ask me again what i want to watch, and only for it to end when i press the exit option on my menu can you help me please?

switch (option){
case 1:create_node();break;
case 2:check_if_node_empty();break;
case 3:return_head();break;
case 4:return_tail();break;
case 5:length();break;
case 6:display();break;
case 7:exit(0);break;
default: cout<<"Choose from 1 to 4";break;
}

this is my code
Add something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
do {
switch (option){
case 1:create_node();break;
case 2:check_if_node_empty();break;
case 3:return_head();break;
case 4:return_tail();break;
case 5:length();break;
case 6:display();break;
case 7:exit(0); string x = "Exit"; break;
default: cout<<"Choose from 1 to 4";break;
}
}
while(x != "Exit");
Topic archived. No new replies allowed.