char option;
FILE *fp;
errno_t err;
err = fopen_s(&fp, "../AVL Trees/input.txt", "r");
while (!feof(fp))
{
fscanf_s(fp, "%c", &option); //error is here
...
}
これはAVL Treesプロジェクト用です。 私はなぜこのエラーが発生したのか理解できません: "十分な引数がフォーマットに渡されていません"、何か不足しましたか?ビジュアルスタジオ2017を使用中にエラーが発生しました:fscanf_s
編集:
1>e:\visual studio projects\avl trees\avl trees\main.cpp(27): warning C4473: 'fscanf_s' : not enough arguments passed for format string
1>e:\visual studio projects\avl trees\avl trees\main.cpp(27): note: placeholders and their parameters expect 2 variadic arguments, but 1 were provided
1>e:\visual studio projects\avl trees\avl trees\main.cpp(27): note: the missing variadic argument 2 is required by format string '%c'
1>e:\visual studio projects\avl trees\avl trees\main.cpp(27): note: this argument is used as a buffer size
のような呼び出しを使用する必要があります変数オプションが宣言されましたか? –
私はそれほど役に立たないと思うが、ここでそれは(編集された) – Gundal
現在の問題とは関係ない他の便利な読み方(しかし、次のものに役立つかもしれない):[なぜwhile(!feof(file)いつも間違っていますか?](https://stackoverflow.com/questions/5431941/why-is-while-feof-file-always-wrong) – user4581301