Sunkal
January 14th, 2003, 08:45 AM
hi, i am just going through accelerated cpp. Using VC, I have written the below code as a console application :
#include <iostream.h>
#include <string>
using namespace std;
int main()
{
string name;
cout << "enter ur name " << endl;
cin >> name;
return 0;
}
On compilation, getting the below error for cin >> name; its exactly as the book says. What is happening here.. please help!!!
f:\sunita\work\helloo\helloo.cpp(8) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable conver
#include <iostream.h>
#include <string>
using namespace std;
int main()
{
string name;
cout << "enter ur name " << endl;
cin >> name;
return 0;
}
On compilation, getting the below error for cin >> name; its exactly as the book says. What is happening here.. please help!!!
f:\sunita\work\helloo\helloo.cpp(8) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable conver