fopen a File Named During Run-time

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Oct 4 07:11:20 AEST 1990


In article <37852 at ut-emx.uucp> albert at emx.utexas.edu (Lo Mau Tout) writes:
>In ANSI C, the prototype of fopen is supposed to be
>FILE *fopen ( const char *filename, const char *mode );
>Does that mean I cannot specify in the position of the first parameter
>a filename[i], where i is an integer, of type char *filename[] ?

Sure you can.  That direction of qualification is compatible.
The other, where you would try feeding a pointer to const to a
function that is expecting to be able to scribble on what is
pointed to, would not be allowed.



More information about the Comp.std.c mailing list