#include <stdio.h>
#include <conio.h>
int fFileMenu(){
printf("This is file menu");
}
int fEditMenu(){
printf("This is edit menu");
}
int fViewMenu(){
printf("This is view menu");
}
int fOptionsMenu(){
printf("This is options menu");
}
int fHelpMenu(){
printf("This is help menu");
}
int main(void)
{
char myAnswer, c;
printf("[F]ile [E]dit [V]iew [O]ptions [H]elp \n"); scanf("%c", &myAnswer);
switch (myAnswer) {
case'f':
case'F': fFileMenu(); break;
case'e':
case'E': fEditMenu(); break;
case'v':
case'V': fViewMenu(); break;
case'o':
case'O': fOptionsMenu(); break;
case'h':
case'H': fHelpMenu(); break;
default: printf("I think your answer is Maybe ?\n");
}
c = getch();
return 0;
}
it writes menu's and when you pressed first letter it goes to function that you wanted. after this, program closes. But i dont want it. i want program that writes ' press z to go back to main function' and when you presed z it goes to main f. and it doesnt close. i wrote programe again. i made it for only file menu. but it doesnt worked for me. if you help me. thx for reading(sry for bad english.)