Helllo、マルチレベルフィードバックキューの初期化のための構造
マルチレベルのフィードバックキューを構築しようとしていて、データ構造にアクセスする際に問題があります。
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
がタイプstruct str1 *
またはstruct mystruct *
でありながら
ptr->p = front;
ptr->p
で
転記中に "str1"構造体の名前を "mystruct"に変更しましたか? – wildplasser