海盐房子有增值空间吗:C++代码错误。请高手指教。。。。

来源:百度文库 编辑:神马品牌网 时间:2024/05/09 16:53:29
#include "stdafx.h"
#include "iostream.h"

int main()
{
int c;
while((c=getchar())!=EOF)
{
if(c>'A'&&c<='z')
c=c-'A'+'a';
putchar(c);
}
return 0;
}

错误代码如下:
F:\Program Files\Microsoft Visual Studio\MyProjects\exercise2\exercise2.cpp(8) : error C2065: 'getchar' : undeclared identifier

F:\Program Files\Microsoft Visual Studio\MyProjects\exercise2\exercise2.cpp(12) : error C2065: 'putchar' : undeclared identifier
高手啊。调试通过了。。
stdio.h
stdafx.h
这2个有什么区别`???????????

还有多问一句。是不是程序本身没问题。
只是头文件用错了??

吧stdafx.h换成stdio.h

stdio.h 最常用的基本的类的东西吧
含有输入输出什么的
你在。NET环境下写的么/
#include "stdafx.h" 这个不清楚
不错STDIO 是C语言里的一个东西
IO这个是C++的东西吧

你用的getchar和putchar是stdio里定义的,你要把sdeio.h包含一下

没错。没有加包含PUTCHAR语句的头文件
加上这句:#include"stdio.h"

没有头文件啊 加上 stdio.h 看看