You can use arrays of char to act as a string of characters:
Code:
#include <iostream.h>
int
main()
{
char you[50];
cout<<"how are you?";
cin>>you;
cout<<"You are:"<<you;
cin.get();
cin.get();
return 0;
}
For responses with more than one word, cin>> won't get it all. In that case you need cin.getline():
Code:
#include <iostream.h>
int
main()
{
char you[50]
cout<<"how are you?";
cin.getline(you, 50);
cout<<"You are:"<<you;
cin.get();
cin.get();
return 0;
}
And if your compiler is new enough, C++ style strings are preferable to C style strings:
Code:
#include <iostream>
#include <string>
using namespace std;
int
main()
{
string you;
cout<<"how are you?";
getline(cin, you);
cout<<"You are:"<<you;
cin.get();
cin.get();
return 0;
}