INF: C2059 and C2065 May Be Caused by Not Including STDIO.H

ID Number: Q65304

5.00 5.10 6.00 6.00a 6.00ax | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

In Microsoft C versions 5.0, 5.1, 6.0, 6.0a, and 6.0ax, when a

function prototype has a pointer of type FILE in the parameter

list and STDIO.H is not included, it will give the error on the "*"

because the compiler assumes that FILE is a data name instead of a

typedef, which it really is. To eliminate the error, include STDIO.H

before the FILE typedef is used in the code.

The same problem (not including STDIO.H) may manifest itself as the

following error message:

C2065 : 'FILE' : undefined

The workaround is the same.

Sample Code

-----------

void test(FILE *fp); // This line will cause the C2059 error.

void main ()

{

FILE *fp; // This line will cause the C2065 error.

test(fp);

}

void test(FILE *vp)

{

}

Additional reference words: 6.0 6.00 6.0a 6.00a 6.0ax 6.00ax quickc

s_quickc 2.0 2.00 2.01 2.5 2.50 2.51