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樹項目。 我不明白爲什麼我有這個錯誤:「沒有足夠的參數通過格式」,我錯過了什麼?使用visual studio 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