Ok im still having problems.
the code didnt work because my function newParts = readNewSupply(supplyFile) was trying to read a text file like a binary file.
so Ive changed it to just use Fgets to read the strings but when I try and read the first record wich is 6 digits long it reads the entire record instead. so instead of just displaying the ID which is something like abc123 it displays the ID, description and quantity records.
inFile = openFile(inFileName, "rb+");
supplyFile = openFile(newSupplyFile, "r");
exceptionFile = openFile(exceptionFileName, "w");
newParts = readNewSupply(supplyFile);
parts = readParts(inFile);
if (strcmp(newParts.id, parts.id) == 0)
All im trying to do first is get the first 6 digits which is the id then ill go on from there but it displays the whole file.
newParts_struct readNewSupply(FILE *supplyFile)
what annoys me is that I can get fgets to read exactly how i want it to if I start a new file, but the exact same code wont work in this program.