I have the following code, and I keep on getting the "Program has stopped working" error after I have input the characters.
I have done some debugging and found that the issue is in the writing to the file part, however I cannot find the issue.
Can anyone help me? (I'm new to C)
#include <stdio.h>
int main()
{
char characters;
printf("Input your characters: ");
scanf("%s", &characters);
FILE *fp = fopen("File.txt", "w");
fprintf(fp, "%s", characters);
fclose(fp);
}