Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 1.48 KB

widen.md

File metadata and controls

55 lines (43 loc) · 1.48 KB

widen

  • ios[meta header]
  • std[meta namespace]
  • basic_ios[meta class]
  • function[meta id-type]
char_type widen(char c) const;

概要

char 型の文字を char_type 型の文字に変換する。

戻り値

use_facet<ctype<char_type>(getloc()).widen(c)

備考

ストリームに設定されているロケールに従って、char 型の文字 c を対応する char_type 型の文字に変換する。 詳細は ctype::widen を参照。

#include <iostream>

int main()
{
  const wchar_t c1 = std::wcout.widen('0');
  const wchar_t c2 = std::wcout.widen('\\');
  std::wcout << c1 << L", " << c2 << L'\n';
}
  • std::wcout[link ../../iostream/wcout.md.nolink]
  • widen[color ff0000]

出力

0, \

バージョン

言語

  • C++98

参照