#include <iostream> #include <string> using namespace std; // A simple name-echoing program. // Art Lee, January 8, 2001 // int main () { string s; cout << "Please enter your name: "; getline(cin, s); cout << "Hello " << s << endl; cout << "Have fun in cs2010...!..." << endl; return 0; }
If, when you try to compile it this way, Emacs tries to compile with the command make -k, you made a mistake during the Emacs installation. (If you try to compile a C program, e.g., hello.c instead of a C++ program, e.g., hello.cpp, it will try make -k. In that case enter the compile command, gcc -g hello.c -o hello -lm, manually. After you try it manually once, from second time on it will do the right thing automatically.)