|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: problem
look at the syntax of the fscanf. I believe that it is actually
fscanf(fp,format desc,variables);
Your fscanf is using the syntax of fscanf(format desc, variables);. I think
your problem is in the fscanf statement. Look at the docs on fscanf.
Thanks,
Jason Brunson
----- Original Message -----
From: Toby <Wiederbelebung@gmx.de>
To: <gameprogrammer@gameprogrammer.com>
Sent: Thursday, June 29, 2000 1:40 AM
Subject: problem
> Hi
> #include <stdlib.h>
> #include <stdio.h>
> #include <string.h>
>
>
>
> /**************************************************> main <*/
> int main( void )
> {
> int myData = 7;
> FILE *fp;
> fp = fopen( "My Data File", "r" );
> fscanf( "%d", &myData );
>
> printf( "Goodbye..." );
>
> return 0;
> }
>
> Why doesn't this compile? It says that it can't convert char * to
> struct_file.
> How can I read in a single number from a file?
>
> By
> Toby
> P.S.: I think I don't need all those includes.
> =================================================================
> The GameProgrammer.Com mailing list is for the open discussion
> of any topic related to the art, science, and business of
> programming games. This list is especially tolerant of beginners.
> We were all beginners once
>
> To SUBSCRIBE or UNSUBSCRIBE please visit:
> http://gameprogrammer.com/mailinglist.html
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html
|
|