I am just little bit confused, what I am trying to do is, I am sending a packet across a network through my code, now when I am creating a packet, I have defined IP Address to be of the type char ipaddr[15]; It all works well and good with this, but most of the times I have seen people using unsignedlong ipaddr Clearly, I think I am doing something wrong. Is it compulsory to make it unsignedlong or char ipaddr[15] is fine?
I even tried to convert it using ntol() and such system calls but it keep giving error.
That's the thing, the IP address I have to use is stored in a text file. Now from the text file I have got it into a
MAP but in a string format. Now can this string IP be converted into unsigned long?