Like in CMD, to run a C++ program, I use the command g++ filename.cpp, then I run it using the command a.exe, which opens the output in the CMD itself. How to do such thing using a PowerShell? I am unable to open the file by simple command as a.exe. Am I doing it the wrong way?
It is a best practice to use the invocation operator and to quote the command.
& ".\a.exe" p1 p2 p3
PowerShell will also allow the use of / as the path separator.
& "./a.exe" p1 p2 p3 "p4 with space"
by running g++ filename.cpp on PowerShell it generates a.exe file by default on running a.exe it gives an error
so follow these commands
g++ filename.cpp -o filename.exe
filename.exe
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