I'm in my first semester at university studying C programming. We've gained an introduction to modularising our code, and the basic gist of my problem is that I've created a function which prompts the user to continue or exit the program. Obviously I have a few other functions before this and I call these in main(). Bear in mind the functions are in separate C files. I wish to loop back to main() if the user inputs 'Y' (i.e. to start the program from the beginning), but given my beginner knowledge I've had a hard time figuring out how to go about this. Any help/guidance would be appreciated!
int continueOrExit() {
char response;
char upperResponse;
printf("Do you wish to continue the program? Y/N");
scanf("%c", &response);
upperResponse = toupper(response);
while(upperResponse == 'Y')
main(); // this is the bit which I struggle with
.....
}