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';
}
xxxxxxxxxx
#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';
}
出力
0, \
バージョン
言語
- C++98