作者:asx | 来源:互联网 | 2022-12-06 19:57
1> CIsForCOOKIE..:
你为什么不在循环内打印?
for(int i = 0; i
如果您只想将每个第二个字符复制到另一个数组中,那么您的错误就是使用相同的索引 word[i] += input[i];
并且正如@bcperth所提到的,也使用+ =运算符而不是常规赋值 '='
你应该做的是:
word[i/2] = input[i];
#include
#include
int main(void) {
char* p = "hello world";
char s[32] = "";
for(int i = 0; i
输出:
hlowrd
2nd option
hlowrd