I want to translate the following C snippet in assembley:
----------------------------------
FILE *filenum; //the file is filled with integer number
int v[1000]; //betwen two integer number are 0D,0A characters

while(!feof(filenum))
{
fscanf(filenum,"%d",&v);
i++;
}
------------------------------------
I could use ReadFile API and put the whole file in a buffer, but I don't know if the numbers will be in the v place! and then i must
rearrang the buffer and throw away others ASCIIS witch are not
numbers.
Or I can use fscanf, importing from a VC++ library(but I want the
fastest reading and maybe fscanf isn't so fast!)
Or i can code somethig like ReadFile and read character by character from the file and then put each number in the big array, but i will invoke ReadFIle too many times...

Please tell me witch method shall i use to be the fastest!
All i want to do it to read numbers from a file and then invoke a
sorting function witch will sort the number array.

Thanks,
MatriX
Posted on 2001-11-03 16:35:31 by MatriX
I suggest skipping the translation and write code from scratch. Problems you should focus on are:
   •Can you reserve memory or need to allocate it.
   •What format is the filie in (Constant record lengths, etc.)
   •What is the best sorting method
Posted on 2001-11-03 17:53:29 by eet_1024