#include <stdio.h>
void main()
{
char a[] = "123";
char b[10];
char *s, *p;
s = a;
p = b;
//取s的值,s自加,取p的值,p自加,将old_s的值赋给old_p
while(*p++ = *s++);
s = NULL;
p = NULL;
printf("%s\n", b);
}
时间: 2024-10-20 08:48:04
#include <stdio.h>
void main()
{
char a[] = "123";
char b[10];
char *s, *p;
s = a;
p = b;
//取s的值,s自加,取p的值,p自加,将old_s的值赋给old_p
while(*p++ = *s++);
s = NULL;
p = NULL;
printf("%s\n", b);
}