c - 错误: expected ')' before numeric constant (fwrite)

标签 c compiler-errors fwrite

我在网上搜索了解决方案,但仍然找不到。所以我在这里注册了,希望你们中的一些人可以帮助我。我还在学习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/

相关文章:

c - 作为参数发送到后台子进程的空闲内存

c++ - -Wunused-variable 编译器说错误

安卓错误: cannot find symbol class ActionBarActivity

c - 我的老师声称这个代码块在 O(n) 时间内运行……这是为什么呢?

c - 显示功能不打印任何结果

c - BMP 颜色替换器 : Algorithm for padding doesn't work

c++ - 如何编译使用 C++11 库 API 的 C++03 项目?

c - fwrite 和 fread 的问题

VC2012 中与 fwrite 的混淆

c++ - 保存和加载 C++ 程序