代码应该接受数组大小和一组字符的输入,并将它们作为大写字母输出。我的问题是,当我输入像“我爱巧克力”这样的句子时,它会返回ILOVECHOCOLATE。问题是我如何获取输入?或者我在别的地方失去了空间?#include <cstring> void readString(char*, int);void displayString(char*, int);
int mai
我正在尝试做一个程序,让用户输入他们的全名只有字符可以接受。然而,当我在一个字符后面输入一个数字时,验证被跳过了。include <ctype.h>
{ int i = 0; fflush(stdin); // used to clear the buffer and accept the next string
fgets