<string>
using namespace std;
That worked. However, being that it has its own header file, I assumed it would work better than using a character array, but I still have the same problem.
#include <iostream>
#include <string>
int main()
{
string Name;
Name = ""
cin<<Name<<endl;
cout<<"Hello <<Name<<endl;
}
If I input Thomas, the output is:
Hello Thomas
However, if I input Thomas Anderson, the output is
Hello Thomas
How can I include spaces and such in one string?



LinkBack URL
About LinkBacks



