特牛网址导航

getch计算机错误,strcat在简单getch类密码输入上引发分段错误-CSDN博客

网友收藏
文章浏览阅读135次。我使用的是Linux,有一个自定义函数返回一个ASCIIint当前键的类型getch(). 当我试图习惯它以及如何存储我遇到问题的密码时,我的代码如下:int main() {int c;char pass[20] = "";printf("Enter password: ");while(c != (int)'\n') {c = mygetch();strcat(pass, (char)c);p..._error: conflicting types for ‘mygetch’ 46 | char mygetch()