networking · intermediate · ~15 min
Decode sin_addr back into octets.
Implement void be32_to_ipv4(unsigned addr, int *a, int *b, int *c, int *d) extracting the four octets (a = most-significant byte).
void be32_to_ipv4(unsigned addr, int *a, int *b, int *c, int *d) {
/* TODO */
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.