g++ - Can't execute compiled C++ exe file -
i having trouble executing c++ code. have written basic "hello world" program, , compiled using g++ make command. here code:
#include <iostream> using namespace std; int main() { cout << "hello world" << endl; return 0; } i on windows 10, using emacs code editing, , cygwin compilation. saved file hello.cpp. navigated directory in cygwin. did command make hello. created hello.exe. then, attempted execute file using ./hello.exe. tried ./hello didn't work. when type 1 of these commands , hit enter, on next line, not doing anything. can type in blank line, won't anything. know way make code execute properly. thank you.
edit: tried running @ cpp.sh, online c++ compiler, , worked fine.
your program working console window closing before can see anything.
try adding input @ end of program wait.
i.e.
int a; cin >> a;
Comments
Post a Comment