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 seperator , these values come from the command line, just assume that the seperator 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 doesnt 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 charachter pointer and set it to the first occurance 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 seperator and the line from b to file
Thanks for reading