最終更新日時:
が更新

履歴 編集

function
<cwchar>

std::fwscanf

namespace std {
  int fwscanf(FILE* stream, const wchar_t* format, ...);
}

概要

書式を指定して、ファイルストリームからワイド文字列を入力する。

戻り値

代入に成功した項目の数を返す。最初の変換が行われる前に入力が終端に達した場合はWEOFを返す。

#include <cwchar>
#include <cstdio>
#include <iostream>

int main()
{
  int a = 0;
  int count = std::fwscanf(stdin, L"%d", &a);

  std::wcout << count << L' ' << a << std::endl;
}

出力例

1 42

バージョン

言語

  • C++98

関連項目