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.所以出现了这个问题。

你可能感兴趣的:(typedef)