Question about file I/O from a newbie
Got some problems with basic file I/O on binary file. It seems like i can write to the file bacause its beeing created. But when i type in information, write it to file, and then reading from file, it seems OK. But if i close the program and try to open the file, all that its printed are just jibberish.
// My defines
#define TY 20
#define FY 50
#define HD 100
#define TI sizeof(struct TestInfo)
#define CO sizeof(struct Course)
My write to file:
My read from file:
void write_to_file(struct Course *co)
The way i call them:
void read_from_file(struct Course *co)
if(!(inFile = fopen("courseinfo.bin", "r")))
struct Course new_course;
Can anyone see whats from with my functions (or something else for that matter)?