I'm having trouble displaying a string and integers through the use of stringstream. The code below displays fine as is but say I put in << endl after name. When I compile this it only displays the name string and thats it. If I add a space in any of the strings it will also only display the previous variables and end at the space. Some of the variables include doubles, integers and strings in the out variable of type stringstream. Tell me if I have my logic of stringstream incorrect because this is my first time using this technique.
//Opens a stringstream and allows integers to be displayed as a string stringstream out; string dateString; //stores integers and strings into a string out stream out << "Name:" << name << "Temperament:" << tendency << "Weight:" << weight << "Height:" << height << "Location:" << location << "DOB:" << dateInception << "Death:" << dateDeath; //displays the string using the command out instead of cout out >> dateString; cout << dateString;