I am trying to code a console program. I should get floating point numbers from console and save the result in a qword variable. I know in C threre is scanf("%f",&variable) function. But I don't how to do that in asm-console. Need any code.

Posted on 2005-04-22 14:28:32 by highenergy
Hi :)

You could link to the actual C function (search the board for integrating your asm programs with C libraries). This is probably the easiest way.

Another option would be to read the standard input "by hand" (calling GetStdHandles to get the handle, and ReadFile to read from it) and parsing that input yourself (the MASM32 library comes with some handy functions for it, and so does the Shell Lightweight Library that comes with Windows). This is probably the hardest way.

I don't know of any Win32 API call that does exactly the same job as scanf. :(

Hope this helps! :)
Posted on 2005-04-22 15:19:02 by QvasiModo
msvcrt.dll exports same functions as C libraries. Afaik it comes with Windows, not with VS, so you can use it freely.
Posted on 2005-04-23 05:52:55 by Arvensis