#include "unistd.h"
#include "stdlib.h"
#include "stdio.h"
#include
#include
#include
int
main(int argc, char **argv)
{
int mqid;
size_t len;
long int type;
struct msgbuf *ptr;
if (argc != 5)
fprintf(stderr,"usage: msgsnd
len = atoi(argv[2]);
type = atoi(argv[3]);
mqid = msgget(ftok(argv[1], 0), 0200);
ptr = calloc(sizeof(long) + len, sizeof(char));
ptr->mtype= type; //26行
ptr->mtext=argv[4]; //27行
msgsnd(mqid, ptr, len, 0);
exit(0);
}
总是出现如下错误:
[root@localhost ch6msg]# gcc msgsnd.c -o msgsnd
msgsnd.c: 在函数‘main’中:
msgsnd.c:26: 错误:提领指向不完全类型的指针
msgsnd.c:27: 错误:提领指向不完全类型的指针
哪位高手能不能帮忙解决下
blue216 于 2009-02-24 13:36:13发表:
太感谢了!问题解决了!
deepwhite 于 2009-02-24 12:21:19发表:
http://topic.csdn.net/t/20041223/11/3669686.html
have a look