Mail Archives: djgpp/2002/04/09/11:28:39
At 07:28 09/04/2002 -0700, you wrote:
>Hi all,
> Well I cannot understand where i am going wrong. Well i am trying to
>read some values from a file and store them in a 2D array of
>structure.The points are stored in file in this way:
>0 0 93.515722
>0 20 93.756786
>....
>20 0 96.049438
>20 20 93.200324
>....and so on(192 rows of values in all).
>
>I need the points in 2d array coz i am using them to plot on screen .
>struct points
>{
> float x;
> float y;
> float z;
>
>} pts[16][12];
>
>the loop:
>for(i=0;i<17;i++){
> for(j=0;j<13;j++){
> fscanf(data,"%d %d %f",&pts[i][j].x,&pts[i][j].y,&pts[i][j].z);
> }
>}
Your program halts because expect read 17*13 values . Try to change upper
limits for i and j to 16 and 12, respectivally.
Regards.
JL
>I get this error when i run the program (compiled with BCC 3.1)
> scanf: floating point formats not linked
> abnormal program termination
>and it stops responding when compiled with DJGPP , i have to CTRL-BRK
>to get out of it.
>
>Please tell me whats going wrong(i hope it is not very foolish:), i
>desperately need some help.Thanx in advance
>
>Regards
>Pradeepto
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
- Raw text -