printf should have a prototype的错误怎么改正?
Turbo c 问题点数:20、回复次数:8Top
1 楼prototype(原型)回复于 2002-04-03 04:27:24 得分 0
???Top
2 楼qianqiansong(就是不说)回复于 2002-04-03 05:32:05 得分 0
错误信息,不是你的id:)
printf should have a prototypeTop
3 楼prototype(原型)回复于 2002-04-03 05:51:34 得分 10
i meant what the error was. anyway, never mind.
did you include the header '<stdio.h>'?
btw, this is probably not relevant to you question: the prototype of 'printf' should be something like:
printf( const char*, ... )Top
4 楼jishiping(JSP 季世平)回复于 2002-04-03 07:20:29 得分 10
你没有包含有文件stdio.h。在你的CPP开始,添加下面一行:
#include <stdio.h>Top
5 楼poly30(POLY)回复于 2002-04-03 09:37:09 得分 0
1.可能是没有#include <stdio.h>
但这不是主要原因
2。你的printf()中的实参的形式不对
把原码贴上来Top
6 楼qianqiansong(就是不说)回复于 2002-04-03 23:51:42 得分 0
谢谢楼上诸位得回复。
原来我用得是#include<iostream.h>
改成#include<stdio.h>后,出现新得错误:
代码如下:
#include<stdio.h>
void main(void)
{
long int one_million=1000000;
printf("one million is %ld\n",one_million);
}
第二行出现异常
Top
7 楼prototype(原型)回复于 2002-04-04 02:48:28 得分 0
your question is not clear. so others have to guess your problem.
which line is '第二行'? and what kind of '异常
'?
#include<stdio.h>
^^
what is that? i guess it is not the same as '#'. change it to '#'.
also change 'void main( void )' to 'int main(void)' (the 2nd
'void' can be omitted. but it is ok.).
then your code is ok.Top
8 楼niniu(你牛)回复于 2002-04-04 09:17:39 得分 0
可能你用的是BC,那么就应该包括头文件stdio.h
你可以看帮助嘛
Top




