+ 1
somethings wrong with compiler
whats wrong with my compiler?, i wrote a program then delete it, and try to write another one, but when i run program, my compiler starts to run program that i deleted. does anybody know whats wrong?
3 ответов
+ 2
A possibility would be that you have forgotten to 'build' your project.
Some C++ compilers have two different buttons, one that says
"Build and run"
and one that only says
"Run",
at least that is the case in Code::Blocks, the compiler I am using for C++.
Since C++ is a compiled language, any changes in the code lead to the need to recompile your code. That is what 'Build' means. It will compile your program.
So if you only press the "Run"-Button without previously compiling your project after changes in the code, the compiler will simply execute the last succesfully compiled version.
Of course, this is just a possible error source.
+ 2
Have you created a new project? Then this should not happen.
Or just a new file within the project?
+ 2
Open the working directory and delete "a.out".