구조체 선언에 대한것인데요.
글쓴이: puresupe / 작성시간: 수, 2008/09/24 - 6:03오후
1 #include
2
3 struct list_node{
4 char str[4];
5 struct list_node *link;
6 };
7
8 struct list_node *ptr=NULL;
9
10 int main(void)
11 {
12 ptr = (list_node*)malloc(sizeof(list_node));
13 printf("%d",sizeof(*ptr));
14 return 0;
15 }
16
~
null_pointer.c: In function 'main':
null_pointer.c:12: error: 'list_node' undeclared (first use in this function)
null_pointer.c:12: error: (Each undeclared identifier is reported only once
null_pointer.c:12: error: for each function it appears in.)
null_pointer.c:12: error: expected expression before ')' token
이런 에러가뜨는데
잘못된거 없지않나요?
Forums:
typedef 를 안 쓸
typedef 를 안 쓸 요량이라면
혹은
OTL
댓글 달기