I have written a program that is far too long to copy to this site. But what is needed will be pasted into the website.
Here is the switch statement:
void enterName();
int adminChoice;
printf("\nEnter Numeric Choice: ");
scanf("%d", &adminChoice);
switch(adminChoice)
{
case(1):
{
enterName();
}
}
Here is the actual function:
void enterName()
{
FILE *fp = fopen("/home/matthew/Desktop/BBE.txt", "w");
if (fp == NULL)
{
printf("Error opening file!\n");
exit(1);
}
char comment[100];
printf("Enter, String\n");
fgets(comment, sizeof comment, stdin);
fputs(comment,fp);
}
What happens is the program asks for user input of a string. But does not allow for time to put in a desired string. It just ends the program.