Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 583
  • Last Modified:

Get an IP address from sin_addr

How do I get an IP out of the sin_addr struct.
iIP is the int that receives the IP address

int iIP;

// this is the way that the program I am looking at points to the struct
// so I want to get iIP = the IP address from
pClientData->inetSock.sin_addr;
0
ketut
Asked:
ketut
1 Solution
 
alexoCommented:
unsigned long iIP = pClientData->inetSock.sin_addr.s_addr;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now