ChinaUnix.net
相关文章推荐:

struct inaddr

struct bit{ int a; int b; int c; }; int main(int argc, char *argv[]) { bit s; char *c = (char*)&s; *c = 0x99; cout << s.a << endl; cout << s.b << endl; cout << s.c << endl; }

by dutysmart - C/C++ - 2013-07-25 21:50:43 阅读(1164) 回复(2)

相关讨论

请哪位大哥指教一下inaddr_ANY,这个MACRO是怎么定义的?

by angelarrive - C/C++ - 2011-09-30 10:59:22 阅读(2538) 回复(4)

socket 受不了了, 英语是一大困惑, 只能慢慢学, 但SOCKET 下的bind() 这里的设置都不知, 真受不了了, 希望大家帮详解一下的意思: sa.sin_addr.s_addr = htonl(inaddr_LOOPBACK); // 1 这是什么意思, inaddr_LOOPBACK ??? sa.sin_addr.s_addr = htonl(inaddr_ANY ); //2 这是什么意思, inaddr_ANY ??? 两者的区别是什么???

by militala - C/C++ - 2008-11-05 18:07:21 阅读(2854) 回复(2)

inaddr_ANY就是指定地址为0.0.0.0的地址,这个地址事实上表示不确定地址,或“所有地址”、“任意地址”。 一般来说,在各个系统中均定义成为0值。 例如MontiVista Linux中在/usr/include/netinet/in.h定义为: /* Address to accept any incoming messages. */ #define inaddr_ANY ((in_addr_t) 0x00000000) 一般情况下,如果你要建立网络服务器应用程序,则你要通知服务器操作系统:请在某地址 xxx.xxx.xxx.xxx上的...

by 5204669 - Linux文档专区 - 2007-08-08 16:04:44 阅读(481) 回复(0)

`inaddr_ANY' undeclared (first use in this function) google 了也没找到有线索的东西. 不知道是哪的原因 ? 还有这个: storage size of `server_addr' isn't known 谢谢.

by bst - C/C++ - 2005-04-04 18:47:02 阅读(4964) 回复(3)

struct sockaddr_in my_addr;   my_addr.sin_addr.s_addr = inaddr_ANY;   其中inaddr_ANY就是指定地址为0.0.0.0的地址,这个地址事实上表示不确定地址,或“所有地址”、“任意地址” int opt = 1; int len = sizeof(opt); setsockopt(pSockData->so_fd,SOL_SOCKET,SO_REUSEADDR,(const char *)&opt,len); SO_REUSEADDR 为true 就是允许在相同的端口不同的IP地址上创建套接描述字。 这样的目的是根据允许断开前后 监听...

by markman101 - C/C++ - 2011-12-01 17:24:28 阅读(2218) 回复(1)

[color="#000066"]Socket inaddr_ANY详解 inaddr_ANY就是指定地址为0.0.0.0的地址,这个地址事实上表示不确定地址,或“所有地址”、“任意地址”。 一般来说,在各个系统中均定义成为0值。 例如在ubuntu的/usr/include/netinet/in.h定义为: /* Address to accept any incoming messages. */ #define inaddr_ANY ((in_addr_t) 0x00000000) 一般情况下,如果你要建立网络服务器应用程序,则你要通知服务器操作系统:请...

by gofiend - Linux文档专区 - 2008-12-08 15:08:25 阅读(842) 回复(0)

inaddr_ANY的用法 作者:gdx_2008 日期:2007-12-16 10:00:00 inaddr_ANY就是指定地址为0.0.0.0的地址,这个地址事实上表示不确定地址,或“所有地址”、“任意地址”。 一般来说,在各个系统中均定义成为0值。 例如MontiVista Linux中在/usr/include/netinet/in.h定义为: /* Address to accept any incoming messages. */ #define inaddr_ANY ((in_addr_t) 0x00000000) 一般情况下,如果你要建立网络服务器应用程序...

by zxgang_andy - BSD文档中心 - 2008-04-06 14:53:25 阅读(1051) 回复(0)

struct timespec struct itimerspec数据结构是怎样的,各个数据成员代表什么意义? 在哪里可以得到帮助文档? 谢谢各位解决小弟的问题

by xiaokousky - C/C++ - 2008-10-01 19:22:29 阅读(3960) 回复(1)

struct A { char a; char b; int c[0]; }; sizeof(A) = 4; 为什么呢? 注意: struct A { char a; char b; int c; }; sizeof(A) = 8;

by embeddedlwp - C/C++ - 2011-11-28 23:19:15 阅读(11675) 回复(54)

请问这个语言是什么意思呢? typedef struct { unsigned char cid[20]; unsigned char gcid[20]; unsigned long long filesize; int is_created; int is_cid; int is_gcid; unsigned int task_id; }TASK_PARA; 上面的语句跟下面这个有什么区别? typedef struct kt { unsigned char cid[20]; unsigned char gcid[20]; unsigned long long f...

by gswen - C/C++ - 2011-02-18 23:22:58 阅读(2026) 回复(4)