#include<iostream>
#include<cstring>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
struct Node
{
wchar_t str1[64];
wchar_t str2[64];
};
int main()
{
Node *p = new Node;
wchar_t *strArr = L"HelloWorld";
wcscpy_s(p->str1, L"HelloWorld");
wcscpy(p->str2,L"WorldHello");
cout << strArr << endl;
printf("%ls\n", strArr);
char ch[64] = { 0 };
sprintf(ch, "%ls", strArr);
printf("%s\n", ch);
cout << sizeof(p->str1) << endl;
cout << p->str1 << endl;
cout << p->str2 << endl;
return 0;
}
指的注意的是,sizeof(p->str1)=64*2,宽字节一位占两个字节。