一段代码,不理解
#include <stdio.h>
void My_strcpy(char * a, char * b)
{
while (*b++ = *a++);
}
int main(void)
{
char a[] = "hello whorld";
char b[100] = {1};
My_strcpy(a, b);
printf("%s\n", b);
getchar();
return 0;
}
void My_strcpy(char * a, char * b)
{
while (*b++ = *a++);
}
int main(void)
{
char a[] = "hello whorld";
char b[100] = {1};
My_strcpy(a, b);
printf("%s\n", b);
getchar();
return 0;
}
不懂while (*b++ = *a++);这一句whilex循环的结束条件是什么?是*a为"\0"时结束还是*b为"\0"时结束?