okay so i am now writing code for an assignment where i have to write to a binary file a report for a teacher to use for a class where it will write to the file in this format:
idNumber Name gender classlvl ProgrammingScores TestScores
111111111 last, first M 11 00 00 00 00 00 00
for any amount of students and with the only thing is that i can only use 44 bytes per student meaning a stucture with members all type char.....
the other thing is that i have to have each function on it's own file, so making a header file and compiling the .o files of the functions with the main function that will be using the functions to do things....
my problem is so far with the deleting and adding scores....now i was wondering if there was a simple way to just call a function that could help me to find the student by id number and append one of the three scores???
also i have the problem of having to once i find the data freeing it well that is easy just make an array and once i find a match just freading it to a tmp pointer and then freeing it..the problem is that is there also a way to find the student by idnumber so i can call free()???
if not i will have to read to an array manipulate that array to either delete and then write over...but that seems to time consuming...and probably slow utilizing more resources to make it happen...
same for the scores should i just read to an array the file and then manipulate just the scores and then write them back???
but without knowing the end of the file i would most likely get an error because it is difficult to manipulate a binary file in such way...
any suggestion would help sorry i don't have any plausible source code since most of my source code right now is being converted to the more complex way of having multiple loops where it will read to an array, then manipulate the array, and then rewrite the students back to the file...