whchar字符处理那些事

  是以前没学好,还是怎么了!很多基础的库函数都不太会用,得好好学习学习~

1. whcar_t* 转 wchar_t数组

1 wchar_t* lpp = L"45!~!www.452.com"2 wchar_t lcpUrlInfo[100] ={NULL};

3 wcscpy(lcpUrlInfo,lpp);

2. wcstok分割字符串

 1 //why not wchar_t*??

 2 wchar_t lcpUrlInfo[100] ={NULL};

 3 

 4 wcscpy(lcpUrlInfo,lpp);

 5 

 6 wchar_t *seps =L"!~!";

 7 

 8 wchar_t* token;

 9 

10 token = wcstok(lcpUrlInfo,seps);

11 while (token != NULL)

12 {

13       token = wcstok(NULL,seps);

14 }

 

你可能感兴趣的:(char)