struct and typedef

#include <stdio.h>
#include <stdlib.h>

typedef struct 
{
        int a;
} abc;

struct tcp_server
{
     struct abc b;
};

int main( int argc, char** argv )
{

}

用gcc编译的时候会出现:
test22.c:11: error: field ‘b’ has incomplete type
abc 本来就是 struct { int a}; 的别名,然后使用的时候又加了struct.所以出现了这个问题。
posted @ 2011-02-23 11:04  lxgeek  阅读(267)  评论(1编辑  收藏  举报