I will put g++ filename.cpp and then ./a.exe after making a change and it doesn’t change the output in the terminal. So for example if I put a 🙂 at the end of the last string, it wouldn’t update what it puts in the terminal even after doing g++ filename.cpp. I’ve tried deleting the older a.exe file before doing g++ but it doesn’t fix the problem.
Please make sure you are actually using the GCC Compiler and that you are not getting errors at the moment of compile your code. You can use this to check the compiler:
g++ --version; if you don’t have the compiler installed, it will give you an error.
Also, at the moment of compile your code, you should use the g++ installed on your computer with the .cpp file that you want to compile and create the .exe file.
Here we have Basic00.cpp having a simple “hello world”:
Then, we run
It will create the a.exe file:
Now you just need to run
And, if you want to add “:)” at the end of the string, you just need to add it, compile the code again (step 2) and run the exe file (step 4):
I recommend that you read this about how to use VS Code with G++ to compile and run your code without having issues. Very important: Remember that you need to compile your code every time that you make a change.
Edit with the new Image: I checked your image and the tab is showing a white circle, it means that you are not saving the changes, press Ctrl+S (to save) or configure Auto Save on File -> Auto Save, after saving compile your code again and run the .exe file.