then what is it?? this is really weird
This is a discussion on reading words using fread within the C Programming forums, part of the General Programming Boards category; then what is it?? this is really weird...
then what is it?? this is really weird
I think you need to post more code and perhaps attach an input file.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
I was wondering if because the file was a UNIX type.. it does not have any file extensions, any .txt or anythng
and the input file is 22MB so I can't attach it
Okay, I only tried with a 32MB file, so I'm still guessing that it's part of the code that you haven't posted.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
here's a testing code that I used
so you wan't me to post the 22 MB file?Code:int main(){ FILE* fp = fopen("BIG", "r"); char* word; while (NULL != (word = getword(fp))){ printf("%s\n", word); } return 0; }
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
so what should I do here? it's weird that it works using other files...but there's this file called BIG that doesn't works
Post the whole code.