Sorry if this has been asked before but I have looked around and couldn’t find anything.
I open VS Code in Developer Prompt with “code”, I use the “cmd” compiler. My code is not incorrect. But when I update something and save, the terminal spits out the same thing before the same.
For example if I have
int a = 1
int b = 2
std::cout << a + b;
It will say 3 properly. If I change the b into a 3, instead of 4, it will still print 3 even after saving and recompiling.
Hopefully this make sense. It’s really frustrating and putting huge roadblocks in the course because I can’t follow along.
Restarting developer command prompt doesn’t help. Reopening the file folders doesn’t do anything either.
I have updated the values to equal 6 in both print outs. I saved, and reran it. Even opened a new terminal and all. Still has the old numbers.
It’s not just numbers too. When I tried to put the endl command to print the number on a new line the first time, it did not update either. The next day when I came back to it, it randomly did.
And update after googling further, if I hit Ctrl + Shift + B and then try to run it, it updates. Hit any key to close terminal, type out triplex again to run it, and it updates.
Not sure why I have to do this but the guy in the video doesn’t.
To clarify you weren’t compiling after making these changes? That would be why, that source file is not what you are executing, you are executing the compiled program.
That source code is translated to machine code by the compiler via several steps. You could theoretically delete that file after compilation and still run the program as after it’s been translated to machine code it’s not used.
Where does Gavin make changes to his code and not compile to see the effects of the changes?