#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
typedef struct PROCESS{
int priority;
int lifecycle;
int ttl;
}process1,process2,process3,process4,process5,process6;
main(){
PROCESS *waiting_queue;
waiting_queue = process1; //this is were I get the error.
waiting_queue =(PROCESS *)malloc(6*sizeof(PROCESS));
if(!waiting_queue){printf("no memory for waiting queue "); exit(0);}
getch();
}
私はポインタで構造体配列を作成しようとしています。私はエラーを取得しています。 ';'の前に一次表現が必要です。トークン';'の前の一次式が必要です。トークン
あなたはかなり壊れたように、*型の宣言*と*の構造体*を混合しています。 AFAICT、エラーを取得した行の 'process1'は、構造体ではなく*型*です。文を多少違法にします。 – DevSolar
[Cでmallocの結果をキャストしない](http://stackoverflow.com/q/605845/995714) –