Код
// ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
setlocale(NULL, "RU-ru");
//-------------------------------------------------------
wchar_t *str1 = L"SImple unicode string";
wchar_t *str2 = L"Простой unicode рядок";
wcout << str1 << endl << str2<<endl;
//-------------------------------------------------------
wchar_t ch = 'a';
cout <<"long char\t"<< sizeof(ch)<<endl;
cout <<"char\t\t"<< sizeof('a') << endl;
//-------------------------------------------------------
wchar_t *str3 = L"SImple unicode string";
char*outArr = new char[wcslen(str3)/2];
wcstombs(outArr, str3, wcslen(str3));
cout << outArr << endl;
//------------------------------------------------------
char*str4 = "bla bla bla";
wchar_t *outArr2 = new wchar_t[strlen(str4)];
mbstowcs(outArr2, str4, strlen(str4));
wcout << outArr2; cout << endl;
//------------------------------------------------------
size_t *s1 = nullptr;
wchar_t *str5 = L"SImple unicode string";
char*outArr3 = new char[wcslen(str5) / 2];
wcstombs_s(s1, outArr3, strlen(outArr3), str3, wcslen(str5));
cout << outArr3 << endl;
_gettch();
return 0;
}