I'm trying to copy the data in one text file to another 'new' text file.
The first text file already exists in the directory of the .cpp file.
The second text file is created by obtaining the name of it in the runtime.
The problem i'm facing is that i can't see the 'new' file that is created.
The same code works in codeblocks IDE(The 'new' second file is created), but in Visual studio it isn't created.
Kindly help me out here.
> The test.txt file is in the same folder as the .exe file as well.
Well from memory VS sets the current directory to be your project root directory.
Which might explain why it can't find the file.
I highly recommend that you run programs outside of visual to test them for this reason. Launch the program by double clicking the .exe file or from the command line, and it will behave as expected. Launch it inside visual, and it will bork up the current working path. You can configure VS for each project to do what you want, if you prefer that (that is make it use the working path as if run normally, its doable). I like to run it without VS because if I distribute the program to other people, they won't be launching it from inside VS they will run it directly, so it needs to work in that mode.