Basically i am having problems with my code - this is homework so would rather not post it in here for obvious reasons. If it becomes truely important for me to do so then i will have to as i am so stuck.
i am reading 2 text files and it also has a separator , these values come from the command line, just assume that the separator in this case is xx
File a
a
b
c
File b
d
e
Output should be
axxd
bxxe
cxx
the problem is that my code just doesn't do the last line correctly
i get an output of
axxd
bxxe
I hope you guys can gather what i am doing wrong without me posting all my code, but my logic works on this principle;
while not at the end of the file for files a and b
get a line using fgets from a
create a character pointer and set it to the first occurrence of \n in the line using strchr
if the pointer isn't null
set the pointers value to be the end of line
get the line from b as above
and now write the line from a, the separator and the line from b to file