可以帮我填写代码补充的地方吗#include <stdio.h> #include <conio.h> #define MaxSize 100 typedef struct { char str[MaxSize]; int len; } strtype; void assign(strtype s,char t[]) { int i=0; while (t[i]!='\0') { s->str[i]=t[i]; i++; } s->str[i]='\0'; s->len=i; } void strcopy
时间: 2024-02-22 19:01:15 浏览: 63
一个使用Androidstudio开发的校园通知APP
(strtype s1,strtype s2) {
int i;
for (i = 0; i < s2.len; i++) {
s1.str[i] = s2.str[i];
}
s1.str[i] = '\0';
s1.len = s2.len;
}
int main() {
strtype s1, s2;
char t[MaxSize];
printf("Please enter a string: ");
scanf("%s", t);
assign(s1, t);
strcopy(s2, s1);
printf("s1: %s\n", s1.str);
printf("s2: %s\n", s2.str);
return 0;
}
阅读全文