没大大帮小弟一下吗??

luoxiao_std01 2004-01-22 01:18:34
第一次使用dev-c++时,想熟悉一下环境,就写个无聊的东西,竟然过不去?
停在什么locale_facets.tcc上,请教各位了!

#include <iostream>
using namespace std;
int f(void)
{
return 1;
}

int main(void)
{
int i = f();
cout << " i = " << i << endl;
getchar();
return 0;
}
...全文
52 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
help!
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
ding
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
to fierygnu(va_list):
我觉得错误信息应该看不出什么吧?
你手边有环境吗?
要有,您就试试 cout << 345;
过不去!!!!
晕~~~
fierygnu 2004-01-22
  • 打赏
  • 举报
回复
用Tools->Check for Update升级一下看。代码没问题。
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
to fierygnu(va_list):
version:4.9.8.0
720 D:\DEV-CPP\include\c++\bits\locale_facets.tcc
instantiated from `_OutIter std::num_put<_CharT, _OutIter>::_M_convert_int(_OutIter, std::ios_base&, _CharT, char, char, _ValueT) const [with _ValueT = long unsigned int, _CharT = char, _OutIter = std::ostreambuf_iterator<char, std::char_traits<char> >]'
fierygnu 2004-01-22
  • 打赏
  • 举报
回复
我希望看到的是具体的错误信息。
另外你的dev-c++是什么版本?
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
to fierygnu(va_list):
第一次使用dev-c++,想熟悉一下环境,就写个无聊的东西,竟然过不去?
停在什么locale_facets.tcc上,请教您了!

#include <iostream>
#include <cstdio>
using namespace std;
int f(void)
{
return 1;
}

int main(void)
{
int i = f();
cout << " i = " << i << endl;
getchar();
return 0;
}
fierygnu 2004-01-22
  • 打赏
  • 举报
回复
出什么问题?????
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
问题和getch()无关!
而是cout << i << endl;出问题,若改为printf("%d",i);可以,
没人帮忙吗??????
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
问题好象是
cout << "example" << endl;可以

cout << 234 << endl;却过不去!
困惑呀!!!
fierygnu 2004-01-22
  • 打赏
  • 举报
回复
getchar是标准库函数。C++规定使用函数前必须有函数的原型声明。用#include <cstdio>或#include <stdio.h>都行,前者在std名字空间里,后者在全局名字空间里。
另外C99现在也要求这样严格。
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
to goalbar(莫菲斯)
stdio.h is c header file
iostream is c++ header file
同理,有".h" is c header file,oterwise is c++ header file.
goalbar 2004-01-22
  • 打赏
  • 举报
回复
为什么用DEV c++时

#include<stdio> 提示错误:stdio: No such file or directory.
必须加“.h”
其他的库函数好像有的也是这种情况
是因为c和C++的关系
还是因为Dev的问题
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
找到问题,是优化问题!
谢谢各位!
qfknet 2004-01-22
  • 打赏
  • 举报
回复
老大~给你的getchar()加上个说法OK?
zhangfjj 2004-01-22
  • 打赏
  • 举报
回复
使用getchar()函数,要包含stdio.h
在前面加上一句
#include <stdio.h>
goalbar 2004-01-22
  • 打赏
  • 举报
回复
错误提示:
12 C:\cpp\t-4.cpp
implicit declaration of function `int getchar(...)'
隐式说明函数有错误

我试了,在 “getchar();”前加“int”就行了
不知程序的目的是什么
Wolf0403 2004-01-22
  • 打赏
  • 举报
回复
像是安装的问题。另外一个小建议:用
cin.get() 代替 getchar()
luoxiao_std01 2004-01-22
  • 打赏
  • 举报
回复
我先睡去吧。
fierygnu 2004-01-22
  • 打赏
  • 举报
回复
升级了吗?我试了,没问题。

64,631

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧