Your question is not clear since there is no default variable type in C++ which can hold an IP Address as an IP Address. However, if you have to use this IP Address for some sort of Socket communication, you will have to use a structure like
sockaddr_in
. If it is so, here is a solution (Taken from
here[
^]:
int rc;
int s;
struct sockaddr_in myname;
memset(&myname, 0, sizeof(myname));
myname.sin_family = AF_INET;
myname.sin_addr = inet_addr("129.5.24.1");
myname.sin_port = htons(1024);