#ifndef UNICODE
typedef std::string tstring;
#else
typedef std::wstring tstring;
#endif
#include "stdafx.h"
#include <Windows.h>
#include <string>
#include <iostream>
#include <vector>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
wcout.imbue(locale("chs"));
//这里的const不能省,不然push_back时报错
vector <const tstring *> v;
const tstring* str = new tstring(TEXT("hello中文"));
const tstring* str2 = new tstring(TEXT("hello中文2"));
//cannot convert parameter 1 from 'const tstring *' to 'std::basic_string<_Elem,_Traits,_Ax> &'
v.push_back(str);
v.push_back(str2);
for (unsigned int i=0; i<v.size(); i++)
{
wcout << "-->" << *v[i] << endl;
delete v[i];
}
return 0;
}