please help:
i got a file, like this:
1
4
7
40
6
etc... (every line finishes with 13,10 symbols)
I want to read this integers into array. HOW??? i don`t wanna read each byte ::)
Piece of code pls ))) any )))
So, thank U anyway...
Hi DR#m,
If I am not wrong, Hutch's masm32 library provides a function to read lines from files. You need to convert ASCII strings to number with atodw or a similar function.
DR#m,
welcome to the forum. You should take the time to read the rules, among them you will see:
- this is not the place to ask for answers to homework or assignments
- don't just ask for complete pieces of code, not without doing some of the code yourself first
Your question looks suspiciously like homework to me. I am going to close this thread for now, but feel free to ask questions again once you have written some of the code and you are having specific problems.
As for file handling functions, check here: MSDN: file handling functions (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/file_management_functions.asp), and more specifically ReadFile (http://msdn.microsoft.com/library/en-us/fileio/base/readfile.asp) and ReadFileScatter (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/readfilescatter.asp) for reading a file's contents.
Also remember that an array is just a section of memory, it is how you handle it and access it that makes it an array :U
Lastly, check out the lib files shipped with MASM, there are file handling functions in there (check out masmlib.hlp).
I have a routine in Files.lib that will read a text file line by line and pass the lines to a callback routine. The lib is available from my website.