while (1)

{

if (feof(text) != 0)    //find EOF

{

puts("Reading Finished");

break;

}


tmp = fgetc(text);    //check every character

if (tmp == ' '||tmp==NULL||tmp==' ')        //find blank(Space-Bar)

{

fseek(text, -chCount, SEEK_CUR);

//move file cursor to head of a word

word = (char*)malloc(sizeof(char)*(chCount));

//dynamic allocation for single word

fscanf(text, "%s", word);

//store word from text.txt to char* word

printf("%d ", strlen(word));

//print length of word array(string)

puts(word);

vCount += checkBEv(word);

//check whether beV or not

free(word);

//delete array

chCount = 0;

//chCount means length of single word

//after checking word, clear it zero

fseek(text, 1, SEEK_CUR);

//for skip blank. IT IS NECESSARY!

  }

chCount++;

//for skip blank. IT IS NECESSARY!

}

---------
txt파일에 영어신문 기사를 복붙해놓고, 그걸 읽은뒤 be동사가 몇개인지 세는 프로그램임.
fgetc로 한자 한자 읽어 tmp(char)에 저장해놓고 현재 단어 갯수가 몇개인지 chCount로 셈.
도중에 빈칸, 널, 개행이 튀어나오면 fseek으로 chCount만큼 뒤로가기 해서 단어 갯수만큼 문자열 동적할당해줌
예컨대 fuck you라는 문자열이 있으면 fuck뒤의 빈칸 보고 5개짜리 문자열 할당한뒤 be동사 여부 체크하고, you로 넘어가는방식.
그런데 엔터 부분 잡아낼려고 tmp==' '하니 실행시키니 오류남

어케해야함?