struct node{ char name[16]; int id; struct node *next; }; struct node *stu1; sturct node *p; .......//some code stu1->next=p; // 报:warning: assignment from incompatible pointer type 哪错了? 谢谢
by john.daker - C/C++ - 2009-07-01 16:02:57 阅读(6964) 回复(9)
1. gcc version 4.1.2 2. 部分源码: int compare_name( dir_ const *a, dir_ const *b) { return strcmp(a->name, b->name); } int sort_dirs(dir_ *dirs, int dir_index) { qsort(dirs,dir_index,sizeof(dir_),compare_name); return 0; } 3. 编译时: gcc -c -Wall -O2 -fPIC -I../include -o ../src/log/rollover.o ../src/log/rollover.c ../src/log/rollover.c: In function...
dereferencing pointer to incomplete type dereferencing pointer to incomplete type 的错误也是未包含某些头文件造成的! 分析数据包:判断通信双方的操作系统、网络信息流量、通过路由的数据包大小、数据包内容。 以太网:以太网的桢? 以太网中,数据是以被称为帧的数据结构本为单位进行交换的。 现在最常用的帧格式MAC V2 v2帧的格式: (插入8字节)目的地址(6字节)-源地址(6字节)-类型(2字节)-数据(46-150...
我反复检查了代码,是没有错的。 在网上简单搜了一下,说是头文件包含的问题。 我这网络访问受限,百度快照都打不开,只能跑这来问问了。 好心人给指点个迷津。:lol:
socket 编程中,通过gethostbyname() 或者 gethostbyaddr 取得主机的 hostent 解构的信息, 现在从中提取出地址信息: [code] struct host * host; struct sockaddr_in address; .... ... ... memcpy (&address.sin_addr, host->h_addr_list[0], sizeof(address.sin_addr)); 或者: address.sin_addr=*((struct in_addr *)host->h_addr); [/code] 编译的时候出现这样的错误: error: dereferencing pointer to incomplete type ...
自己试着去实现一个二叉查找树,程序有3个文件,bsearch.h,bsearch.c和main.c。
bsearch.h中这样:
[code]struct TreeNode;
11
12 typedef struct TreeNode* Position;
13 typedef struct TreeNode* SearchTree;
14 /******************************/
15 typedef int Elementtype;
16 /******************************/
[/code]
bsearch.c中这样:
[code] #include
“dereferencing pointer to incomplete type”是什么错误? I use gcc to compile my C file.
#define __USE_GNU 1
#include
Hi all, I found the following function, which is used to remove the head of a linked list. void RemoveHead(node **head) { node *temp; if (head && *head) { /* Corrected code */ temp = (*head)->next; free(*head); *head = temp; } } 1. Why is the purpose of 'head' in the 'if' condition? Shouldn't '*head' suffice? 2. This function has an argument, which is a po...
warning: return makes integer from pointer without a cast 这样的warning怎么解决??谁能帮偶下~谢谢
原来在windows下能运行的程序,移植到linux下,出现上述错误,请大侠不吝赐教! 附部分相关代码: struct listen { char Cookie; long RequestTimeStamp; long RequestFileSize; struct listen *left, *right ; }listenqueue; struct BufferQueue *h=NULL ; h=(struct BufferQueue *)malloc(sizeof ( BufferQueue)); h->Cookie=a ; h->RequestTimeStamp=finish ; h->RequestFileSize = (rand()%100) ; h->le...