This could be a codeblocks question but as is often the case, my code is more than likely the cause of this problem.
When I compile my program (code below) and run it, it should display the contents of a vector in the output screen. When I run it from the IDE by hitting 'RUN' button (code::blocks), it don't see any output in the output console. But, if I go to the exe file directly and click on it, the output shows in the console.
Would anyone know why this is?
For the code below, it refers to a textfile containing a line of numbers comma delimited "11, 12, 13, 14, 15".
For Code::Blocks, you need to have the data in the root directory of the project if you want to run from the IDE. If you want to have it runnable both from the IDE and the bin/debug folder (or wherever the .exe is) then there should be an option in the project options to change the working directory for your targets.
What is probably happening here is that the code is not finding the text file, so ss is empty, meaning you are outputting a vector of size 0. You may want to put some error checking in to your code anyway, e.g. if (!myfile.isOpen()) return 1;
or something like that (its been a while since I used files, and I can't be bothered to look it up).
NT3, you're a legend. That is exactly what is wrong with it.
You're right, the text file could not be found. I had to put the text file in the root directory to make it work. I'm sure I discovered this once before and have forgotten about it.
Thanks for the solution. This was really giving me a headache.