Our lecturer gave us a program to look over in the holidays. Unfortunately I think he has forgotten we havenít done any file handling in C yet. Iíve had a look around on some other websites to see if I can self teach myself some stuff. In my opinion I think from what I have picked up this piece of code should work? Iím trying to add a name to a txt file that already has some data in it Ö
From the examples I read online they were only printing text already present in the source code into the text file. But I am assuming that itís possible to add the content of a variable to a text file?
When I run the program I enter a name and then press enter and the program closes. When I check the text file nothing has changed at all. Please help
printf("\nPlease enter a students name to add them to the data base.");
fp = fopen("collegerecord.txt","a");
//puts("Function associated with menu option 'b' called sucessfully");