prompts the user with and reads a string of text from the u
prompts the user with >> and reads a string of text from the user
what would the line look like to put this in a line in a script
Solution
Answer:
cin is used together with the extraction operator, which is written as >> This operator is then followed by the variable where the extracted data is stored.
string mystr;
cout << \"enter a string \";
cin>>mystr;
program:
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string mystr;
cout << \"enter a string \";
cin>>mystr;
return 0;
}
