somethings wrong with compiler | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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?

21st Nov 2018, 8:48 PM
Hayko
Hayko - avatar
3 Answers
+ 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.
21st Nov 2018, 10:29 PM
Shadow
Shadow - avatar
+ 2
Have you created a new project? Then this should not happen. Or just a new file within the project?
21st Nov 2018, 10:23 PM
HonFu
HonFu - avatar
+ 2
Open the working directory and delete "a.out".
21st Nov 2018, 11:20 PM
non