delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f |
From: | eplmst AT lu DOT erisoft DOT se (Martin Stromberg) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Please help where am i wrong |
Date: | 9 Apr 2002 14:53:43 GMT |
Organization: | Ericsson Erisoft AB, Sweden |
Lines: | 30 |
Message-ID: | <a8uv9n$rah$1@antares.lu.erisoft.se> |
References: | <5a91d0ef DOT 0204090628 DOT 64a394f0 AT posting DOT google DOT com> |
NNTP-Posting-Host: | lws256.lu.erisoft.se |
X-Newsreader: | TIN [version 1.2 PL2] |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Pradeepto K Bhattacharya (pradeeptob AT yahoo DOT com) wrote: : 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); Try the format string " %f %f %f". You might need to do something about each line ending as well. Right, MartinS
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |