你用的开发工具是什么?vc 6.0 吗?我在FreeBSD下编译运行了,没有任何问题。getchar()函数返回的就是int 类型的,‘m’作为字符类型可以隐士转换为 int 类型。
#include"iostream"
using namespace std;
int main() {
char a,b;
a=getchar();
if(a=='m') cout<<"monda";
return 0;
}照你说的这样可以运行未发现错误啊
#include
你的分号怎么是中文的啊