gpt4 book ai didi

c - 错误: too many arguments to function 'getch'

转载 作者:行者123 更新时间:2023-11-30 14:47:27 24 4
gpt4 key购买 nike

 int i;
char c[4]={'\0'},a[4],*pin="1234";
do
{
DARK_GREY;
printf("\nEnter 4 digit Pin: ");
WHITE;
for(i=0;i<4;i++)
{
// error: too many arguments to function 'getch'
a[i]=getch(c[i]);
printf("*");
}
}

最佳答案

getch(); 函数用于将输出屏幕保持一段时间,直到按下任意键为止。

int getch(void);

getch()void 参数,因此使用如下:

a[i]=getch();
c[i] = a[i];

关于c - 错误: too many arguments to function 'getch' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51235042/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com