#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int main() {
	stringstream  sstream;
	sstream.write("foo\0bar", 7);
	string str;
	sstream >> str;
	cout << str;
}