All pastes #489104 Raw Edit

ptlis

public cpp v1 · immutable
·published 2007-05-15 11:02 UTC
rendered paste body
#include <sstream>#include <fstream>int main(int argc, char** argv) {	std::string	name = "foo",				description = "bar";	bool	holdItems = 1,			moveable = 0,			compositable = 1;	std::ofstream fout;	fout.open("temp.txt");	std::string temp;	std::ostringstream stream;			// stringstream object to strings to ints	fout << name << std::endl;	fout << description << std::endl;	if(!(stream << holdItems))	return false;	// something broke	temp = stream.str();	fout << temp << std::endl;	stream.clear();	if(!(stream << moveable))	return false;	// something broke	temp = stream.str();	fout << temp << std::endl;	stream.clear();	if(!(stream << compositable))	return false;	// something broke	temp = stream.str();	fout << temp << std::endl;	stream.clear();	return 0;}