替换C中字符串中的字符 cstring Replacing characters in strings in C 我最近开始使用C,但在理解" 相关讨论 @ user3121023或者更合理地是%c或getchar()。 考虑(使用)scanf(" %c", replacechar) –"读取单个字符跳过前导空白(例如,读取response[0]后剩下的换行符)。 n 在C中,*和 相关讨论 不需要变量" buf"。只需使用scanf("%c", &replacechar);和scanf("%c", &newchar);