Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 874 Bytes

wctob.md

File metadata and controls

51 lines (36 loc) · 874 Bytes

wctob

  • cwchar[meta header]
  • std[meta namespace]
  • function[meta id-type]
namespace std {
  int wctob(wint_t c);
}
  • wint_t[link wint_t.md]

概要

ワイド文字を、1バイト文字へ変換する。

効果

cが初期変換状態において1バイトのマルチバイト文字として表現できる場合、そのバイト値へ変換する。

戻り値

変換できた場合はそのバイト値をunsigned charからintへ変換した値を返す。表現できない場合はEOFを返す。

例

#include <cwchar>
#include <iostream>

int main()
{
  std::wcout << (std::wctob(L'a') == 'a') << std::endl;
}
  • std::wctob[color ff0000]
  • std::wcout[link /reference/iostream/wcout.md]

出力

1

バージョン

言語

  • C++98

関連項目

  • btowc: 逆方向の変換