怎么给char数组赋值

2024-12-03 10:22:56
推荐回答(1个)
回答1:

char str[256]={ "123" };
char str1[256]={ '1','2','3',0 };
char str2[256];
char str3[256];
char str4[256];
int i; for ( i=0;i<10;i++ ) str2[i]=' ';
scanf("%s",str3);
strcpy(str4,"Hello!");