C语言程序编译以后一直显示stdio.h里报错,为什么,怎么修改?求大神!

显示的错误是:
c:\program files\microsoft visual studio\vc98\include\stdio.h(36) : warning C4518: 'extern ' : storage-class or type specifier(s) unexpected here; ignored
c:\program files\microsoft visual studio\vc98\include\stdio.h(36) : error C2143: syntax error : missing ';' before 'string'
c:\program files\microsoft visual studio\vc98\include\stdio.h(36) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
ex03.obj - 1 error(s), 0 warning(s)

检查 #include <stdio.h> 以前的 程序,错在前。
-----------------------------------------------
c 程序,扩展名 用 .c, 不要用 .cpp
c++ 程序,扩展名 用 .cpp 不要用 .c
c++ 程序 若用 stdio.h 时,先要含 c++ 的头:
#include<iostream>
using namespace std;
#include <stdio.h>追问

我的程序是前面是:
#include "ex03.h"
#include "stdio.h"
#include "stdlib.h"

ex03.h是老师给的头文件

追答

你先去掉 ex03.h
// #include "ex03.h"
#include "stdio.h"
再编译 CL ex03.c -c
如果没错,就是 ex03.h 有问题。

追问

恩我去掉了确实就没问题了,但是必须得加上那个ex03.h呀
是说我在ex03.h里的代码有问题是么

追答

是的。ex03.h里的代码有问题。
你看看它 是否 少了 } 或 宏语句 的结束 或类似的 东东。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-11-19
你确定是c?追问

用visual c++编的c

第2个回答  2013-11-19
第一个是extends这个单词吧?追问

就是extern

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网