Simple way to read data file (float)?

Discuss PocketC for CE (including Desktop Edition)

Postby Maxim on Sat May 19, 2001 8:09 am

I'm trying to finish my 1st and simple PocketC application ...

I need to load some data file ( M(lines)xN(columns) array of floating point figures where the figures from the same line are separated by spaces) into PocketC application and I can not figure out any simple way to do it. What would be some analog of the following piece of code:
<pre id=code><font face=courier size=2 id=code>
//--------------------
in=fopen("data.file","r");
for(i=0; i M; i++)
for(j=0; j N; j++)
fscanf(in,"%lf",&x[i][j]);
//---------------------
</font id=code></pre id=code>
Thanks a lot!

P.S. I dropped sing "less" between i and M (j and N) as it didn't show up correctly.

Edited by - Maxim on 05/19/2001 03:16:45
Maxim
 
Posts: 1
Joined: Sat May 19, 2001 7:34 am

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 1 guest

cron