[Solved] How to increment an IP address in a loop? [C] [closed]
A naive implementation (no inet_pton) would user 4 numbers and print them into a char array #include <stdio.h> int inc_ip(int * val) { if (*val == 255) { (*val) = 0; return 1; } else { (*val)++; return 0; } } int main() { int ip[4] = {0}; char buf[16] = {0}; while (ip[3] < … Read more