I want to reference a alue in a header file to use in my cpp file. The value name of the value is currentaddress. Here is the code…
HOSTENT *pHostEnt2;
int **ppaddr2;
SOCKADDR_IN sockAddr2;
char* addr2;
pHostEnt2 = gethostbyname(NewLogURL.c_str());
ppaddr2 = (int**)pHostEnt2->h_addr_list;
sockAddr2.sin_addr.s_addr = **ppaddr2;
addr2 = inet_ntoa(sockAddr2.sin_addr);
printf("\n Current Website IP:%s", addr2);
I tried this…
char getcurradd(char addr2)
{
return addr2;
}
But it say that I have the wrong value for the function. Any help is appreciated. Thnak you.
I would call it like this…
char CA = getcurradd(*addr2);
This was really simple! I just placed it as a global variable and I now can access it.