请C++高手改正下列程序的错误

来源:百度知道 编辑:UC知道 时间:2024/05/12 04:51:20
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
void main()
{
cout<<"enter\n";
char ch;
char*list;
cin>>list;
ch=getche(list);
cout<<ch<<endl;
}
编译错误为
d:\58001116\58001116\shishi\tree.cpp(10) : error C2660: 'getche' : function does not take 1 parameters
怎样修改

error C2660: 'getche' : function does not take 1 parameters
查俊子
不知道你有没有看过函数 getche 的定义
int getche();
//这个函数不带参数
----------
char *list;
cin>>list;
//这儿应该有问题吧。
可以将 char *list 改为 char list[256];

getche使用错误,请查MSDN或相关文档。

-_-b
<br>
<br>看来你英语不是很好啊...
<br>
<br>给你翻译一下吧
<br> error C2660: 'getche' : function does not take 1 parameters
<br>
<br>getche这个函数不是只有一个参数(看看MSDN上的这个函数的原型,一定是少写了一个或几个参数)
<br>
<br>不好意思,我没有看过这个函数的原型,我只是翻译,有不好地方,多谢指出
<br>