#include <iostream>
#include <string>
using namespace std;
int main(){
string yourName;
cout<<"Enter your name: ";
cin>>yourName;
cout<<"Your name is: "<<yourName<<endl;
return 0;
}
or without using #include <iostream>
using namespace std;
int main(){
char yourName[100]; /*you must declare how much input you're going to read */
cout<<"Enter your name: ";
cin>>yourName;
cout<<"Your name is: "<<yourName<<endl;
return 0;
}
Kind Regards