......... 이 오류는 뭘까요.
푸른나무
질문 제목 : ....오류 해결이 시급합니다(응?)
모르는 오류가 뜨는군요.
질문 내용 : #include stdio.h
#include stdlib.h
#define malloc (node*)malloc(sizeof(node)) //쓰기 귀찮으므로 매크로 지정.
typedef struct node{
char data;
struct node *next;
}node;
int num;//반복 횟수를 전역함수 설정
int i=0;
node *head, *end;
node *temp[];//노드를 배열로 설정해줌(말이 되나;)
void set();
void main(){
node *ptr;
scanf(%d,&num);//n회의 횟수를 입력하겠다고 지정.
for(i;inum;i++){
set();//함수 콜
}
ptr = head-next;
for(i=0;inum;i++){//출력
printf(%2c,ptr-data);
ptr = ptr-next;
}
printf(\n);
}
void set(){
int cnt = num;
int n=0;
char c;
node *ptr;
head = malloc;
end = malloc;
for(cnt;cnt0;cnt--){//노드 입력 반복문.
scanf(%c,&c);
temp[i] = malloc;
temp[i] -data = c;
temp[i] -next = end;
end-next = end;
ptr = temp[i];
}
head -next = temp[0];
} 오류문은
554.obj : error LNK2001: _temp 외부 기호를 확인할 수 없습니다.
C:\Documents and Settings\Apple\바탕 화면\554\Debug\554.exe : fatal error LNK1120: 1개의 확인할 수 없는 외부 참조입니다.
이렇게 두개 입니다. -ㅠ-;;;;