我对这段小代码有一些问题:
int main(int argc, char **argv){
struct ether_addr *s, *d;
u_char dir1[] = {0x00,0x11,0x22,0x33,0x44,0x55};
u_char dir2[] = {0x66,0x77,0x88,0x99,0xaa,0xbb};
s = dir1;
d = dir2;
printf("Together: %s\t%s\n",ether_ntoa(s),ether_ntoa(d));
printf("Apart: %s\t",ether_ntoa(s));
printf("%s",ether_ntoa(d));}
输出应该是相同的,但实际上是:
Together: 66:77:88:99:aa:bb 66:77:88:99:aa:bb
Apart: 0:11:22:33:44:55 66:77:88:99:aa:bb
如果我将两个目录放在同一行,它只会打印其中一个。为什么会这样?