Zu Beginn mit Struktur, mein Code so aussah, und ich den Code kompiliert mit gccFehler trat auf, wenn in der Sprache C-Programmierung
struct pcb{
int pid; /* process id */
int ppid; /* parent process id */
int prio; /* priority */
};
/* process node */
struct pnode{
pcb *node;
pnode *sub;
pnode *brother;
pnode *next;
};
Und es sendet die Nachricht, dass unbekannte Typname ‚pcb
‘. Dann ändere ich den Code entsprechend dem, was ich im Internet gefunden habe, und mein überarbeiteter Code ist wie folgt.
typedef struct pcb{
int pid; /* process id */
int ppid; /* parent process id */
int prio; /* priority */
int state; /* state */
int lasttime; /* last execute time */
int tottime; /* totle execute time */
} pcb;
/* process node */
typedef struct pnode{
pcb *node;
pnode *sub;
pnode *brother;
pnode *next;
} pnode;
Aber neue Fehler sind aufgetreten; Der Compiler hat mir die Nachricht über den unbekannten Typ 'pnode
' geschickt. Ich kann meine Strukturvariable nicht verwenden, wenn ich eine Struktur definiere. Bitte gib mir ein paar Tipps.
dieser http://stackoverflow.com/q/588623/694576 Verwandte. – alk