大神来解读(为什么)
# include <stdio.h>int main (void)
{
char a[2][4]={"aaa","aa"};
int i, j;
for (i = 0; i < 2; i ++)
{
for (j = 0; j < 4; j++)
printf ("%c", a[i][j]);
printf ("\n");
}
return 0;
}
结果是
aaaa
aaaa
###########################
# include <stdio.h>
int main (void)
{
char a[2][4]={"aaa","aa"};
int t, j;
t = 0;
for (j = 0; j < 4; j++)
{
if (a[0][j] != a[1][j])
t++;
}
if (t)
printf ("不相同无<bug>\n");
else
printf ("相同<bug>");
return 0;
}
结果是
不相同无<bug>
请问为什么?