我正在编写一个C程序,它需要接受最多100个字符的用户输入,但是允许用户输入的字符少于这个限制。我试图用一个with循环来实现这个想法,这个循环继续接受char输入,直到用户按enter (ascii值为13),此时循环应该中断。//13 is the ascii value of the return key
scanf("%c", &userText[cou
当用户没有输入任何东西时,我想在我的脚本中运行一个循环。但是当他们输入一些东西时,我希望循环中断。我目前遇到的问题是,当使用input()函数时,脚本将停止并等待输入,但我希望在等待用户输入的同时运行脚本的另一部分。#doing something with input #run this while there is no input 这样,我发现excep