In below code, FileType is a Base class with function VerifyData() as defined. Derived classes then inherit this function and in the main program, instantiate a pointer and call VerifyData(). It gives this error:
In Visual Studio (which is what I know), you can break and it shows you the call stack and you can simply refer to the call stack to determine where in the code the problem appears, exactly. Can you do that with your compiler/IDE?
Quickly glancing at your code, I see you use wcout, but you have strings (line1, line2). So you seem to be mixing string data types. You should commit to one string type and then be consistent. If you ask me, commit to using wide strings everywhere. May or may not be a problem here. Just saying it is best to be consistent.
Well, I had already looked into the stacks, with no avail. The bug is somewhere in the usages of filestreams. Because disabling the filestream code fixes the code.
Anyway, I have modified the code to rely on "FC" command for file comparison and use their exit codes. Works better that way.