The program :
================
================Code:#include <iostream> using namespace std; int main () { int n; cin >> skipws >> n; cout << n << endl; return 0; }
upon compilation throws up the following errors:
====================================
# g++ skipws.cpp
skipws.cpp: In function `int main()':
skipws.cpp:6: `skipws' undeclared (first use this function)
skipws.cpp:6: (Each undeclared identifier is reported only once
skipws.cpp:6: for each function it appears in.)
====================================
upon modification to:
=========================
=========================Code:#include <iostream> using namespace std; int main () { int n; cin >> ios::skipws >> n; cout << n << endl; return 0; }
It now throws up the error:
====================================
# g++ skipws.cpp
skipws.cpp: In function `int main()':
skipws.cpp:6: initializing non-const `int &' with `ios::{anonymous enum}' will use a temporary
//usr/lib/gcc-lib/ntox86/2.95.3/../../../../include/g++-3/iostream.h:206: in passing argument 1 of `istream:perator >>(int &)'
====================================
How do I solve this? Any thoughts?