/*Orion Lawlor's Simple STL Examples, olawlor@acm.org
Shows how to use std::ostringstream.
*/
#include <iostream>
#include <sstream> /* for ostringstream */
#include <string>

int main()
{
	int a=2,b=3,c=4;
	char k='x';
	
	std::ostringstream stream;
	stream<<"Yeah, uh, a=="<<a<<" and b=="<<b<<" and c=="<<c<<" and k=='"<<k<<"'\n";
	std::string formatted=stream.str(); /* pull result out of ostringstream */
	
	std::cout<<"Formatted value: '"<<formatted<<"'"<<std::endl;
	
	return 0;
}
/*<@>
<@> ******** Program output: ********
<@> Formatted value: 'Yeah, uh, a==2 and b==3 and c==4 and k=='x'
<@> '
<@> */
