我无法理解由于以下代码而出现的错误。我正在尝试使用打开文件fopen()
,但这些错误对我来说毫无意义。所以请解释一下整个事情。
10 - FILE * THE_FILE_YOU_READ;
11 - THE_FILE_YOU_READ = fopen("num.txt","r");
这两行单独产生几个警告和错误,如下所示:
11 - warning: data definition has no type or storage class [enabled by default]
11 - error: conflicting types for 'THE_FILE_YOU_READ'
10 - note: previous declaration of 'THE_FILE_YOU_READ' was here
11 - warning: initialization makes integer from pointer without a cast [enabled by default]
11 - error: initializer element is not constant
如果它完全相关,我正在使用 Code::Blocks。我没有在程序的其他任何地方声明这个变量 `THE_FILE_YOU_READ。有什么想法,或者这只是我的愚蠢疏忽?