Hi, I have a C project I am working on, and my t.a. is not much help. The point of the program is to open a .txt file that has names and phone numbers(suposed to be a telephone directory program). I am having trouble opening the file.
my t.a. said to use this:
fp = fopen("a.txt", "r+");
but that gets compiling errors that fp is undefined. I looked on the web a little and came across "FILE'' so I tried
FILE fp;
fp = fopen("a.txt", "r+");
but no luck. I got it to compile by just using
fopen("a.txt", "r+");
but how do I access it to read and write? Thank you for any help
my t.a. said to use this:
fp = fopen("a.txt", "r+");
but that gets compiling errors that fp is undefined. I looked on the web a little and came across "FILE'' so I tried
FILE fp;
fp = fopen("a.txt", "r+");
but no luck. I got it to compile by just using
fopen("a.txt", "r+");
but how do I access it to read and write? Thank you for any help