0

Say if you have the following IP address:

192.168.0.255

How can I store that human readable IP address into a struct in_addr? I'm brand new to network programming in C at this low level, so any help would be greatly appreciated.

Vimzy
  • 1,871
  • 8
  • 30
  • 56

1 Answers1

3

You can do

struct in_addr p;
inet_aton("192.168.0.255", &p.s_addr);
Haris
  • 12,120
  • 6
  • 43
  • 70