We have to character array known as string in C++ using "cin".
In this example, we reading firstName and secondName of a person and printing them.
using namespace std;
char firstName, secondName;
cout<<"What is your first name? ";
cout<<"What is your second name? ";
cout<<"Hi "<<firstName<<" "<<secondName<<endl;
What is your first name? Amit
What is your second name? Shukla
Hi Amit Shukla
total answers (1)
start bookmarking useful questions and collections and save it into your
own study-lists, login now to start creating your own collections.