Please see my code, it works fine by importing the merged two text files to a merged file. But am trying to use void function instead which is not working, I have removed my void function using //, any advise?? will also like to print it out and see how it looks on the console.
After removing ifstreams inside the merge function, it seems to be working, but inside main, merged(); has an error underlined, not sure why but it still works. I also want to print it out on the console. Used: cout<<merged; does not work! any ideas?
Do you understand what rdbuf() does? It returns a pointer to the stream's underlying buffer. http://www.cplusplus.com/reference/ios/ios/rdbuf/
You have no guarantee that all the data from the file is in the stream's buffer.
Your merge function won't compile. Lines 36-38 result in duplicate defined symbols (also declared as arguments on line 33).