I am almost in tears as I am having a problem reading in data from a file into an array of structs.
My stuct is like this:
float price b;
Then my file data is arranged in this way (there is a newline char at the end of each line)
322 10.0 11.3
111 2.45 3.40
433 3.22 4.55
987 19.8 20.0
Then I start to write my program as usual:
// I am woking with unix and use file descriptors. I can use pointers to for those that don't know unix descriptors. Ill take anything at this point
fd = open(filename, O_RDWR, 0777);
// then my problem begins. I have tried FREAD and FGETS, and still cant get my list into the array of structs. Any help appreciated with this.