请教关于程序的问题
#include <stdio.h>#include <string.h>
void main()
{
char a[80]="AB",b[80]="LMNP";
int i=0;
strcat(a,b);
while(a[i++]!='\0')
b[i]=a[i];
puts(b);
}
为什么结果是LBLMNP而不是ABLMNP?
当第八行改成 for( ;a[i]!='\0';i++); 是结果是ABLMNP
这两个程序的差别在哪?
2008-05-05 10:48
2008-05-05 10:50
2008-05-05 10:51
2008-05-05 10:53
2008-05-19 14:49