-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temp.exe not being deleted after run with c++/g++ #164
Comments
Just want to confirm, you are selecting part of C++ code to run, then I will get a lot of |
That is correct, attached is a gyzao link of my project file |
Currently, it will only delete the temporary cpp file. For most language, it is enough. But for complied languages, it also has the binary output. It is not such easy to handle the binary. E.g. On Windows, it would be |
Actually that would be amazing, I would rather have 1 extra file in there than coming back to 50 when trying to get one code snippet just right XD |
Hi @computerwiz160 , this has been improved as a fixed name, please install the latest version and have a try. |
Thank you so much! This is perfect! |
BTW, just for curious, previously I think only script language like JS, Python would run code snippet. For C++, how do you use g++ to run code snippet? It would be helpful to me to understand how user uses the Code Runner and could help me improve it. 😄 |
I actually use code runner as my main compiling tool for c++ in VSCode. I know it was only made to run little snippets here and there, but it's actually a lot more convenient to just highlight all my code and run it directly from VSCode itself, no terminal involved. If I have something that takes a user input I'll use the terminal, but for a lot of my school projects I don't need user input so its very convenient. Code runner uses g++ as default for it, so like I said I just highlight it all and press run. |
Since C++ is a little different with script language like JS, Python. It always need a main function. So you always put your code snippet in main function, select them and run? Not sure the difference of running the code snippet and running the whole file. #include <iostream>
using namespace std;
int main()
{
print("Hello, World!");
return 0;
}
void print(string str)
{
cout << str;
} |
Got it. I guess the purpose of running whole code snippet is you don't want to have an extra "code-runner.saveFileBeforeRun": true After that, you do not need to select all the code to run. |
I'm using code runner to compile some c++ snippets using g++, every time I run my code I get a temp.exe file that was created to run that little bit, however, they're not getting deleted after use so now my project folder has x-number of temp.exe files inside of it until I delete them.
The text was updated successfully, but these errors were encountered: