See if something like this might help. I modified it a bit to suit my compiler.
Code:
#include <stdio.h>
void initMess(void);
void listOptions(void);
int main(void)
{
initMess();
listOptions();
printf("\nThe program terminated normally.");
return 0;
}
void initMess(void)
{
printf("Welcome to my program... blah blah blah.\n\n");
}
void listOptions(void)
{
int testFlag, input;
char choice, trash;
testFlag = 0;
do
{
printf("\n1) do this.");
printf("\n2) do that.");
printf("\n3) how bout this.");
printf("\n4) quit if you must.");
printf("\n\n--> ");
scanf("%d", &input);
switch(input)
{
case 1: printf("\nOption 1 selected.\n"); /* do this */
break;
case 2: printf("\nOption 2 selected.\n"); /* do that */
break;
case 3: printf("\nOption 3 selected.\n"); /* how bout this */
break;
case 4: printf("\nAre you sure you wanna quit? <y:n> ");
scanf("%c %c", &trash, &choice);
if(choice == 'y' || choice == 'Y')
testFlag = 1;
break;
default: /* whatever */
break;
};
}while(testFlag == 0);
}