c++ - String not working with cin! -
i'm having issue simple hello world code.
i'm not able cin name. says no defined operator ">>" can please. below code.
#include <iostream> using namespace std; int main() { int x; string name; cout<< "enter name:"; cin>> name; cout<< "hello "<< name <<endl; system("pause"); }
you have #include <string>.
Comments
Post a Comment