[問題] 想請問一下struct list_head這個結構要怎麼include
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Unix GCC、
Windows XP DEV-C++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
各位前輩好,
小弟最近要撰寫一個程式,是屬於雙向Linked list的,
想使用struct list_head來撰寫,
我用DEV-C++或Unix的GCC來Compiler,都不給我過,
感覺是我沒include到正確的library,
小弟google了半小時,只有教學文章,沒有提到include的問題,
所以最後只能來這樣求助各位前輩,
謝謝大家
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
#include <stdio.h>
#include <stdlib.h>
struct student {
struct list_head list;
int age;
char name[30];
int score;
};
int main()
{
printf("hello\n");
return 0;
}
補充說明(Supplement):
compiler就錯了,顯示:
program.cpp:5: error: field ‘list’ has incomplete type
真的很抱歉,完全沒深度的問題,
但是煩腦我一陣子了,
謝謝各位前輩。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.170.153.133
推
03/06 23:34, , 1F
03/06 23:34, 1F
推
03/06 23:35, , 2F
03/06 23:35, 2F
→
03/06 23:35, , 3F
03/06 23:35, 3F
→
03/06 23:36, , 4F
03/06 23:36, 4F
→
03/06 23:36, , 5F
03/06 23:36, 5F
→
03/06 23:37, , 6F
03/06 23:37, 6F
推
03/06 23:39, , 7F
03/06 23:39, 7F
→
03/06 23:44, , 8F
03/06 23:44, 8F
→
03/06 23:46, , 9F
03/06 23:46, 9F
→
03/06 23:47, , 10F
03/06 23:47, 10F
→
03/06 23:48, , 11F
03/06 23:48, 11F
→
03/06 23:48, , 12F
03/06 23:48, 12F
→
03/07 13:57, , 13F
03/07 13:57, 13F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章