SEED 텍스트 파일을 부른 상태에서
바로 변수로 넣지말고 출력해보라는 조언대로 해보자
왠 이상한 음수값이 나왔습니다.
왜 이런 걸까요??  그 이유를 도저히 알 수가 업습니다..
코드도 적어보겠습니다

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main (){
char eword[255];
char * ptr = eword;
int stack=0;
int i,seed;
FILE * fp = fopen("eword.txt","r");
FILE * fs = fopen("SEED.txt","w");

while( !feof( fp ) ) {
ptr = fgets ( eword, sizeof(eword) , fp);
stack++;
}


fclose(fp);
fp = fopen("eword.txt","r");

seed = fscanf(fs,"%d");
srand ( seed );


for(i=0;i<rand()%stack+1;i++){
ptr = fgets ( eword, sizeof(eword) , fp);
fprintf ( fs, "d", rand()%stack);
}
printf("%s",ptr);

fclose(fp);





return 0;
}