최대 1 분 소요

#include

#ifdef ___________________
일반적인 구조체 선언에 대해 테스트 =»struct_test
구조체를 typedef로 다시 선언하여 테스트 ==» typedef_struct_test
#endif //__________________

#define struct_test

#ifdef struct_test

struct _test{
int i;
int j;
}test, *test1;

//선언되어 있기 때문에 그냥 가져다 쓰면된다.

int main(int argc, char *argv[])
{
test.i=1;
test.j=2;
printf(“%d %d
“,test.i,test.j);

return 0;
}

#endif //struct_test

#ifdef typedef_struct_test
typedef struct _test{
int i;
int j;
}test, *test1;

//형태가 선언되어 있으므로 그것을 사용하기 위해서는 선언해야한다.

int main(int argc, char *argv[])
{
test tes1;
tes1.i=1;
tes1.j=2;
printf(“%d %d
“,tes1.i,tes1.j);

return 0;
}
#endif //typedef_struct_test

\