Check out example codes for "how to declare string in c++ and taking the input". It will help you in understanding the concepts better.

Code Example 1

string fullName;
cout << "Type your full name: ";
getline (cin, fullName);
cout << "Your name is: " << fullName;

Code Example 2

string firstName; //unlike array, no need to mention the size of the sting
cout << "Type your first name: "; 
cin >> 
  firstName; //this is important
  // get user input from the keyboard
cout << "Your name is: " << 
  firstName;

// Type your first name: John
// Your name is: John

Learn ReactJs, React Native from akashmittal.com