Code:#define BUFSIZE 1500 char sendbuf[BUFSIZE]; void send_v4(void) { int len; stuct icmp *icmp; icmp = (struct icmp *) sendbuf; icmp->icmptype = ICMP_ECHO; icmp->icmpcode = 0; /*rest of code*/ }
The question is why force a cast to the array sendbuf? Ie why not do something like
I'm just sort of curious because this type of coding move appears in ping and a lot of unix network printer code.Code:#define BUFSIZE 1500 char sendbuf[BUFSIZE]; void send_v4(void) { int len; stuct icmp *icmp; icmp->icmptype = ICMP_ECHO; icmp->icmpcode = 0; /*rest of code*/ }