dereferencing pointer to incomplete type
글쓴이: 하하 / 작성시간: 월, 2003/11/24 - 4:59오후
#include <fcntl.h> main() { int fd; struct stat *stbuf; fd = open("41.c", O_RDONLY); stat(fd, stbuf); printf(" size of file %d \n", stbuf->st_size); }
m2.c: In function `main':
m2.c:18: dereferencing pointer to incomplete type
위와 같은 에러가 발생합니다.
stbuf->st_size 에서 나는데.. 왜 그런지 도무지 모르겠습니다.
예를 들어 이것저것 해보았지만 포인터에 대한 맴버변수 참조는 -> 로
가능 했습니다. 헌데 위의 것 왜 그런지...... ^____^;;;;;;;
-------------------------------------------------------------------------------------
dereferencing pointer to incomplete type
정의되지 않은 형을 가리키는 포인터 [pointer]에 역참조 [dereference] 연산자(`*')를 쓸 수 없습니다.
struct s;
void g(struct s *);
void f(void)
{
struct s *p;
g(*p);
}
file:6: dereferencing pointer to incomplete type
-------------------------------------------------------------------------------------
Forums:
Re: dereferencing pointer to incomplete type
댓글 달기