在C中,我通常使用getch()函数来等待按下一个键然后结束程序,但是最近我读到了,因为它不是标准函数,所以使用它是不好的编程习惯.
因此,而不是以下:
int main() {
dosomething();
getch(); //wait for the user to see the results and press a key to end
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能更换getch?
| 归档时间: |
|
| 查看次数: |
6452 次 |
| 最近记录: |