// ffffffff.cpp : Defines the entry point for the console application.
//
#include "StdAfx.h"
#include "IO.H"
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <locale>
using namespace std;
wstringstream *pBuffer=new wstringstream();
bool MyWrite(std::wstring& s)
{
pBuffer->clear();
if((*pBuffer)<<s<<std::endl)return true;
return false;
}
bool MyRead(std::wstring& s)
{
if(NULL!=pBuffer)
{
pBuffer->clear();
if((*pBuffer)>>s)
return true;
}
return false;
}
int main(int argc, char* argv[])
{
locale loc("chs");
pBuffer->imbue(loc);
wchar_t ws1[]=L"ddddddddddd";
wstring ws=wstring(ws1);
MyWrite(ws);
std::wstring s2;
MyRead(s2);
std::wcout<<s2;
return 0;
}