getting an error in a program

Nils Kassube kassube at gmx.net
Mon Jun 6 05:22:25 UTC 2011


sudhanshu gupta wrote:
> Its a IrisGL program I am attaching i am getting an error
> 
> sudhanshu at sudhanshu-laptop:~/isosurface$ gcc isonm.c
> isonm.c: In function 'readFile':
> isonm.c:142: warning: format '%d' expects type 'int *', but argument
> 3 has type 'float *'

> Can anyone tell me how to remove that....

The error message tells you that for format '%d' there should be an int 
object but you are using a float object. As you want to use a float 
object you need format '%f'. Therefore change line 142 from

			fscanf(infile,"%d",&coord);

to

			fscanf(infile,"%f",&coord);


Nils




More information about the ubuntu-users mailing list