代码
// ConsoleApplication1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include <sstream>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
std::cout << "Hello World!\n";
stringbuf buffer;
buffer.str("test");
cout << buffer.str() << endl;
getchar();
}
运行效果