>> dont work with string type ??

I was just playing with MS VC express 2010 to remember C++ but I could not compile the following standard code for getting input and display it !

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// a small C++ program
#include <iostream>

using namespace std;
int main()
{
	string name;
	char ch;
	cout<<"Hello, world!" << endl;
	cin>>name;       // error 1
	cout<< name;     // error 2
	system ("pause");
	return 0;
}


it underlines >> operator and says no operator matches these operands !it works fine though if I use char type ch instead of string type.
Can anybody help ?
Last edited on
closed account (z05DSL3A)
#include <string>
DUMB mistake!
thanks!
Topic archived. No new replies allowed.