Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing types??? 1

Status
Not open for further replies.

DanWiFi

Programmer
Jul 7, 2004
7
0
0
US
ok I am a total newbie to this so don't laugh too hard. :)

That said:

I have a uint32 called daddr. it holds the uint32 representation of an ip address. I need to pass it to a function that takes:

Function_One(struct in_addr *ipaddr)

How would I convert that so that I can pass it in?

Thanks
DanWifi
 
Try
Code:
in_addr inaddr;
...
inaddr.s_addr = daddr;
f(&inaddr);
See structure in_addr declaration: it's union and s_addr is a macros to access its 32-bit member...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top