【发布时间】:2012-04-12 18:48:27
【问题描述】:
你好,
我正在尝试构建一个多级反馈队列,但我在访问数据结构时遇到了问题。
struct str1
{
` int time;
int Id;
int Size;
struct str1 *next;
};
struct mlfq
{
int quantum;
int timereached;
struct mystruct p;
};
struct str1 *front; //read from the file and stored.
struct mlfq *ml;
我想要做的是将“mlfq”链接到另一个“前”队列。
在我的插入函数中,我已经分配了内存
struct mlfq *ptr;
struct str1 *temp;
ptr = malloc(sizeof(struct mlgq)
temp=malloc(sizeof(struct str1));
ptr->p = front;
出现错误:分配中的类型不兼容。 现在front已加载,我正在尝试获取队列结构“front”的内容以链接到它。
谁能告诉我发生了什么事?
【问题讨论】:
-
您在发帖时是否将“str1”结构重命名为“mystruct”?
标签: c struct queue feedback multi-level