1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-09-19 22:16:57 +02:00
CodeWars/5kyu/i32_to_ipv4/solution.c

7 lines
192 B
C
Raw Normal View History

#include <inttypes.h>
#include <stdio.h>
void uint32_to_ip(uint32_t ip, char *output) {
sprintf(output, "%d.%d.%d.%d", (ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF);
}