下列程序实现从已有字符串的指定位置复制为新字符串,请将程序补充完整,使程序正确。#include int main(){ int n; char s1[30],s2[30]; void strcopy(char *p1,char*p2); printf(please input s1:); gets(s1); printf(please input n:); scanf(%d,&n); strcopy(s1+n-1,s2); puts(s2); return 0;}void strcopy(char *p1,char*p2){ for( ;________________ ; ) *p2++=*p1++; *p2= ;}
下列程序实现从已有字符串的指定位置复制为新字符串,请将程序补充完整,使程序正确。#include int main(){ int n; char s1[30],s2[30]; void strcopy(char *p1,char*p2); printf(please input s1:); gets(s1); printf(please input n:); scanf(%d,&n); strcopy(s1+n-1,s2); puts(s2); return 0;}void strcopy(char *p1,char*p2){ for( ;________________ ; ) *p2++=*p1++; *p2= ;}
中国大学MOOC: 下列程序实现从已有字符串的指定位置复制为新字符串,请将程序补充完整,使程序正确。#include int main(){ int n; char s1[30],s2[30]; void strcopy(char *p1,char*p2); printf(please input s1:); gets(s1); printf(please input n:); scanf(%d,&n); strcopy(s1+n-1,s2); puts(s2); return 0;}void strcopy(char *p1,char*p2){ for( ;________________ ; ) *p2++=*p1++; *p2= ;}
中国大学MOOC: 下列程序实现从已有字符串的指定位置复制为新字符串,请将程序补充完整,使程序正确。#include int main(){ int n; char s1[30],s2[30]; void strcopy(char *p1,char*p2); printf(please input s1:); gets(s1); printf(please input n:); scanf(%d,&n); strcopy(s1+n-1,s2); puts(s2); return 0;}void strcopy(char *p1,char*p2){ for( ;________________ ; ) *p2++=*p1++; *p2= ;}
编写函数strcopy(char *d,char *s),将指针s所指向的字符串复制到指针d所指向的存储空间中。并在main函数中调用它,实现字符串的复制。请参考6月2号的腾讯课堂的视屏完成。
编写函数strcopy(char *d,char *s),将指针s所指向的字符串复制到指针d所指向的存储空间中。并在main函数中调用它,实现字符串的复制。请参考6月2号的腾讯课堂的视屏完成。
Complete the following function: /* copy string2 to string1 */ void strcopy(char string1[], char string2[]) { int i = 0; while (string2[i] != '\0') { string1[i] = string2[i]; i++; } ____<br/>}[/i][/i][/i] A: return; B: string1[i - 1] = '\0'; C: string1[i] = '\0'; D: string1[i + 1] = '\0';
Complete the following function: /* copy string2 to string1 */ void strcopy(char string1[], char string2[]) { int i = 0; while (string2[i] != '\0') { string1[i] = string2[i]; i++; } ____<br/>}[/i][/i][/i] A: return; B: string1[i - 1] = '\0'; C: string1[i] = '\0'; D: string1[i + 1] = '\0';
Which can replace lines 5 and 6 in the following function ? 1 /* copy string2 to string1 */ 2 void strcopy(char string1[], char string2[]) 3 { 4 int i = 0; 5 while (string1[i] = string2[i]) 6 i++; 7 }[/i][/i] A: while (*string1 = *string2) ; B: while (*string1 = string2) ; C: while (*string1++ = *string2++) ; D: while (*++string1 = *++string2) ;
Which can replace lines 5 and 6 in the following function ? 1 /* copy string2 to string1 */ 2 void strcopy(char string1[], char string2[]) 3 { 4 int i = 0; 5 while (string1[i] = string2[i]) 6 i++; 7 }[/i][/i] A: while (*string1 = *string2) ; B: while (*string1 = string2) ; C: while (*string1++ = *string2++) ; D: while (*++string1 = *++string2) ;