プロが教えるわが家の防犯対策術!

こんにちわ。いつもお世話になっております。

自分で構造体を定義して、それを使ってみたのですがコンパイルエラーが出てしまいます。何がいけないのでしょうか。
以下がそのプログラムです。

struct list
{
struct list *prev;

struct in_addr ip_src, ip_dst;
u_short th_sport;
u_short th_dport;

struct list *next;
};

void
main (u_char * args, const struct pcap_pkthdr *header,
const u_char * packet)
{
static int count = 1;

const sturct list *flow;

return;
}

以上です。

エラー内容は

test.c: In function ‘main’:
test.c:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or

‘__attribute__’ before ‘list’
test.c:17: error: ‘list’ undeclared (first use in this
function)
test.c:17: error: (Each undeclared identifier is reported
only once
test.c:17: error: for each function it appears in.)
test.c:17: error: ‘flow’ undeclared (first use in this
function)

以上です。

どんな些細な意見でも構いませんので、何か気が付かれたら教えて頂けないでしょうか。どうぞよろしくお願いします。

A 回答 (1件)

> const sturct list *flow;



よーっく読んでみましょう。

それにしても斬新なmain()宣言ですねぇ……
    • good
    • 0
この回答へのお礼

main関数の中身は、ただエラー周辺を抜粋しただけなんですけどね。

ご回答有難う御座いました。

お礼日時:2008/11/23 09:06

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!