use*_*234 1 c fopen file stdio
我无法理解由于以下代码而出现的错误.我正在尝试使用打开文件fopen(),但错误对我没有意义.所以请解释整个事情.
10 - FILE * THE_FILE_YOU_READ;
11 - THE_FILE_YOU_READ = fopen("num.txt","r");
Run Code Online (Sandbox Code Playgroud)
仅这两行就会产生一些警告和错误,如下所示:
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
Run Code Online (Sandbox Code Playgroud)
我正在使用Code :: Blocks,如果它完全相关的话.我还没有在程序的其他地方声明这个变量`THE_FILE_YOU_READ.任何想法,或者这对我来说只是一个愚蠢的疏忽?