--- In [email protected], "ozzyapeman" <[EMAIL PROTECTED]> wrote:

> Here is the AFL:
> 
> count = 0;
> fh = fopen("c:\\TestExtractFile.txt", "r");
> 
> if (fh) {
> while(!feof(fh))
> {
> good[count++] = StrToNum(fgets(fh));
> printf("Number: %gn", good[count++] ); // remove the ++ here
> }
> } else {
> printf("ERROR: file can not be found (does not exist)");
> }
> 

You have incremented count twice so when you output the text you are
outputting the value of an array item that has not be assigned to yet.

Your printf statement should be:

printf("Number: %g\n", good[count] ); 


Tuzo


Reply via email to