- 论坛徽章:
- 0
|
原帖由 newtest12 于 2006-9-3 16:54 发表
我在的程序在编译的时候出现如下错误提示:
dereferencing pointer to incomplete type
我定义了这样一个结构
struct connect
{
u_int32_t srcip;
}
struct connect *con;
con->srcip = inet_a ...
1、你的指针能直接这样用???google 指针的用法……
2、
- inet_aton(将网络地址转成网络二进制的数字)
- 相关函数 inet_addr,inet_ntoa
-
- 表头文件 #include<sys/scoket.h>
- #include<netinet/in.h>
- #include<arpa/inet.h>
-
- 定义函数 int inet_aton(const char * cp,struct in_addr *inp);
-
- 函数说明 inet_aton()用来将参数cp所指的网络地址字符串转换成网络使用的二进制的数字,然后存于参数inp所指的in_addr结构中。
- 结构in_addr定义如下
- struct in_addr
- {
- unsigned long int s_addr;
- };
-
- 返回值 成功则返回非0值,失败则返回0。
-
复制代码 |
|