간단한 질문좀요..
아련나래
2023.04.01
질문 제목 : 간단한 질문좀요데이터 파일에 저장되있는 문자나 숫자를 입력하는 방법질문 내용 :
#include stdio.h
#include stdlib.h
#include string.h
#include bst_adt.h
int compare (void* num1, void* num2);
void printbst (void* num1);
int main (void)
{
// local definitions
bst_tree* bstroot;
file *fp;
char datain[20];
//int* dataptr;
//int datain = +1;
bstroot = bst_create (compare);
printf(reading words;\n);
if((fp=fopen(bst.dat, r)) == null) {
puts(file open error: cannot find bst.dat);
return (-1);
}
while((fscanf(fp, %s, datain))!=eof){
// insert read data into bst
}
...................
데이터 파일은
samsung
32
boy
89
cancel
100
abeek
490
guns
80
출력 예 : samsung page 32 이런식..
이런식으로 되있고요
문자와 숫자를출력하려고 하는데 잘 모르겠어요 ㅠ