I am having trouble running C ++ code. I wrote the base program "Hello World" and compiled it using the g ++ make . Here is my code:
#include <iostream> using namespace std; int main() { cout << "Hello World" << endl; return 0; }
I'm on Windows 10, using Emacs to edit code, and CygWin to compile. I saved this file as hello.cpp. Then I went to the directory in CygWin. Then I ran the make hello command. This created hello.exe. Then I tried to execute the file using ./hello.exe . I also tried ./hello , which also did not work. When I type one of these commands and press Enter, it's just on the next line, doing nothing. I can enter this empty string, but it wonβt do anything. Does anyone know how to properly execute my code. Thanks.
EDIT: I tried running this on cpp.sh, the C ++ online compiler, and it worked fine.
source share