I'm a beginner in C and i wrote a function that is supposed to save information to a file, however the file should have different user defined names for multiple users. I asked the user to input their first name before i call the function and then use that first name to name the file. However, as much as I've looked I cannot find it in my notes and nothing I've tried has worked. this is what i have so far
void dude(char first[10], float mark1, float mark2, float mark3, float mark4, float mark5, float mark6, float mark7, float final)
{
FILE *cfPtr;
cfPtr = fcreate("firstname.txt", "w");//i want the file name to be a first name
fprintf(cfPtr, "%s\n\n", first);//this is the user's name
fprintf(cfPtr, "Mark 1 is: %.2f\n", mark1);
fprintf(cfPtr, "Mark 2 is: %.2f\n", mark2);
fprintf(cfPtr, "Mark 3 is: %.2f\n", mark3);
fprintf(cfPtr, "Mark 4 is: %.2f\n", mark4);
fprintf(cfPtr, "Mark 5 is: %.2f\n", mark5);
fprintf(cfPtr, "Mark 6 is: %.2f\n", mark6);
fprintf(cfPtr, "Mark 7 is: %.2f\n", mark7);
fprintf(cfPtr, "Final is: %.2f\n", final);
}