extern 사용 질문,
글쓴이: sunuk / 작성시간: 금, 2011/10/21 - 5:43오후
파일 a.h
extern struct new arr[100];
extern int a;
---------------------
파일 a.c
include a.h
struct new arr[100];
int a;
...
arr[0]=another_arr[0];
a=100;
---------------------
파일 b.c
include a.h
---------------------
할 경우에 b.c에서 arr[100]이나 a를 쓸 수 없나요?
undefined가 나는데 b.c에서 a.c에서 사용한 값을 쓰려면 어떻게하나요? a.h에서 선언할경우 중복선언으로 오류가 생겨서
a.c에서 선언하고자합니다.
Forums:
http://kldp.org/node/108459
http://kldp.org/node/108459
댓글 달기