CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C/C++ >  C语言

printf should have a prototype的错误怎么改正?

楼主qianqiansong(就是不说)2002-04-03 03:51:25 在 C/C++ / C语言 提问

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

相关问题

  • 输入错误,请帮忙改正
  • 找出题中错误,写出错误内容,并加以改正
  • 菜鸟系列:这是什么错误,如何改正?
  • 帮忙改正一个语法错误 万分感谢
  • 这是什么错误?如何改正!在线等!
  • 怎么发现并改正这样的错误!
  • 请问这条语句有错误吗?怎么改正
  • 这个存储过程有什么错误,该如何改正?
  • printf实现错误 求助
  • 关于Excel的简单的问题, 怎样使用改正下面的错误?

关键词

  • printf
  • million
  • include
  • main

得分解答快速导航

  • 帖主:qianqiansong
  • prototype
  • jishiping

相关链接

  • C/C++ Blog
  • C/C++类图书
  • C/C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo