how to sort IP addresses in routing table in C++?

how to sort IP addresses in routing table in ascending order in C or C++? like if we've two same ip addreses, 128.0.0.0 with prefix length 2 and 128.0.0.0 with prefix length 4, the one with 2 precedes 4. pl help!
Topic archived. No new replies allowed.