Thanks on the Count++. It's an improvement. But I still get wrong results:

Number: 5.30979e-037
Number: 0
Number: 0
Number: 0
Number: 0
Number: 0
Number: 0
Number: 0
Number: 0
Number: 0
Number: 0
Number: 0


--- In [email protected], "tuzo_wilson" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "ozzyapeman" <zoopfree@> 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