C++ examples for File Stream:cin
Read string and output
#include <cstdlib> #include <iostream> #include <string> using namespace std; int main(int argc, char *argv []) { string yourName; /* ww w.j av a 2 s.c om*/ cout << "Please type your name and press Enter: " ; cin >> yourName; cout << endl << "Hello, " << yourName << endl << endl; cout << "Press c and then Enter to continue..."; char justWait; cin >> justWait; return (0); }