我在网上搜索了解决方案,但仍然找不到。所以我在这里注册了,希望你们中的一些人可以帮助我。我还在学习C,如果这是一个愚蠢的问题,请原谅。我最近编写了一个代码,一切工作正常,直到我决定添加一个 fwrite,如下所示:
char str[] = "Test.";
fwrite(str, 1, sizeof(str), Console);
我尝试编译它,编译器给了我一个错误:
Main.c:57:13: error: expected ')' before numeric constant
问题是什么,如何解决?
最佳答案
试试这个
char str[] = "Test.";
fwrite(&str, sizeof(char), sizeof(str), stdout);
尽管如此,我认为问题可能是由于代码中其他地方的左括号造成的。
关于c - 错误: expected ')' before numeric constant (fwrite),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22864387/