delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/09/11:28:39

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-Id: <5.0.2.1.0.20020409102331.00baff00@pop.mail.yahoo.com>
X-Sender: jlsgarrido AT pop DOT mail DOT yahoo DOT com
X-Mailer: QUALCOMM Windows Eudora Version 5.0.2
Date: Tue, 09 Apr 2002 10:26:18 -0600
To: djgpp AT delorie DOT com
From: =?iso-8859-1?Q?=22Jos=E9_L=2E_S=E1nchez_Garrido=22?=
<jlsgarrido AT yahoo DOT com>
Subject: Re: Please help where am i wrong
In-Reply-To: <5a91d0ef.0204090628.64a394f0@posting.google.com>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019