February 16, 2003
The following code produces an error about an explicit cast needed for arg 1
of fopen from char to const char. DMC version 8.29n
How do I get this code to work?
Miracle C compiles without warning or errors.


#include <stdio.h>

int main (int argc, char* argv[])
    {
     FILE f;

     f=fopen(argv[1],"r");

     fclose(f);

     return 0;
    }


February 16, 2003
Replace:
    FILE f;
with:
    FILE *f;



"Lars Hansen" <lars.o.hansen@gmx.de> wrote in message news:b2nvhd$1bf7$1@digitaldaemon.com...
> The following code produces an error about an explicit cast needed for arg
1
> of fopen from char to const char. DMC version 8.29n
> How do I get this code to work?
> Miracle C compiles without warning or errors.
>
>
> #include <stdio.h>
>
> int main (int argc, char* argv[])
>     {
>      FILE f;
>
>      f=fopen(argv[1],"r");
>
>      fclose(f);
>
>      return 0;
>     }
>
>