So I'm trying to emigrate from Windows to Linux. Today I'm trying to code and compile stuff with Emacs instead of Windows IDE's. This is my example code:
#include <iostream>
using namespace std;
int main() {
cout << "HELLO" << endl;
}
Which I compiled from emacs using esc-x-> compile-> g++ -o hello hello.cpp
From the terminal, I executed hello using './hello'. Then I changed my code to 'cout << "HOLA FFS" << endl;' and tried to compile using g++ -o hello hello.cpp again. Compilation finished without errors, but when I tried to execute hello from the terminal, the output was "HELLO" and not "HOLA FFS".
Why is it doing this?
Possible reason is that you did not save you code after you changed your code. I do not think it is necessarily have to do with emacs. Remember to C-x C-s frequently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With