Re: error using "struct"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Fernanda,

>cli.sin_addr.s_addr=htonl(192.168.200.241);

The 192.168.200.241 is not a valid number in C/C++. For that, you'd need something like:
htonl((192L << 24) + (168L << 16) + (200L << 8) + 241);


But, shouldn't you do something similar to...

cli.sin_addr.s_addr=inet_addr("192.168.200.241");

...like you did earlier?

--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux