wcschr

wcschr 是寬字元的查找操作。

基本介紹

  • 中文名:wcschr
  • 是什麼:是寬字元的查找操作
  • 輸出結果:中
  • 類型:查找作業系統
簡介,說明,示例,代碼,輸出結果,參考資料,

簡介

#include<wcschr.h>
wchar_t *wcschr(const wchar_t *ws,wchar_t wc)

說明

在寬字元串ws中查找寬字元wc,然後返回第一個匹配wc的位置即指針,如果沒有找到就返回空指針NULL.

示例

代碼

#include <iostream>
#include <string>
using namespace std;
int main()
{
wcout.imbue(std::locale("chs")); //設定語言區域為中國
wchar_t *ws = L"我是中國人";
wchar_t wc =L'中';
wchar_t *find = wcschr(ws,wc);
wcout<<*find<<endl;
system("pause");
return 0;
}

輸出結果

請按任意鍵繼續. . .

參考資料

<string>
<wchar.h>,wcsrchr() , the Base Definitions volume of IEEE Std 1003.1-2001

熱門詞條

聯絡我們