NULL Pointer

I need to cjck if a pointer is NULL. If so theI need it's value to be 0.0.0.0

This is what I have so far.

1
2
3
4
5
6
7
8
9
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);
		
if (addr2 == NULL);
{
addr2 = "0.0.0.0";

Doesn't work. Any suggestions are welcome. Thank you.
Last edited on
Actually it does work! I placed it in the wrong spot! ime for sleep!
Topic archived. No new replies allowed.