text: Hi, I've been reading B. Stroustrup's FAQ and found
  How do I write this very simple program?
  What is interesting is this sentece:
  I test it on my Dev-Cpp compiler with this codeI test it on my Dev-Cpp compiler with this codeThe":
  And after entering Ctrl-Z I saw line "Test is OK".And after entering Ctrl-Z I saw line "Test is OK".Code:#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { vector<double> v; double d; while(cin>>d) v.push_back(d); // read elements if (!cin.eof()) { // check if input failed cerr << "format error\n"; return 1; // error return } if(cin.eof()) { cout<<endl<<"Test is OK"<<endl; } cout << "read " << v.size() << " elements\n"; reverse(v.begin(),v.end()); cout << "elements in reverse order:\n"; for (int i = 0; i<v.size(); ++i) cout << v[i] << '\n'; return 0; // success return }
  Can you comment this?
  I'd like to read your opinion on this.
  Cheers!
  Micko