I jump into a switch statement to handle all my cases. When the case is chosen and the action is carried out, how can i return without just calling the program again ( ex: system("um.exe"); ).
It may seem kind of silly since it's much easier to recall the program, but say at the very beginning of the program i created a file and wrote to it the following phrase: "You ran the following:" , then each case that was carried out would write it's name down in that file. This outside text file would be closed when the program termintated.
#include <stdio.h>
#include <conio.h>
int main()
{
char select;
clrscr();
printf("Choose\n\n1. Msg 1\n2. Msg 2\n");
select=getch();
switch(select)
{
case '1':
printf("press a key...");
getch();
/* what goes here, besides "name of this program".exe */ ;
break;
case '2':
printf("press a key...");
getch();
.......
break;
default:
.......
break;
case 'x':
clrscr();
return 0;
}
}