Dotted IPv4 address reversed with inet_addr

Greetings, I'm using Visual C++ 2010 express from microsoft and am trying to write a dll library for use with another project to send ping requests.
My problem is that
 
unsigned long ipaddr = inet_addr("127.0.0.1")

returns 16777343, which is 1.0.0.127 and not 127.0.0.1
I tried this with different addresses and the issue is the same. I'm running x64 Windows 7 professional under a virtual machine if that has something to do with it. Any help is highly appreciated!
Thats what it is supposed to be, the byte order of an unsigned long is different then an IP address. see http://msdn.microsoft.com/en-us/library/windows/desktop/ms738563%28v=vs.85%29.aspx
Topic archived. No new replies allowed.