Hey guys.
I would like to know if there is a way to use scanf function to read from a file. What should I do? Is there another function as easy to use and as powerful as scanf?
Thanks
Hi vadiu,
Here is an example for you :
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\msvcrt.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\msvcrt.lib
.data
text1 db "Enter a DWORD value :",0
format1 db "%d",0
format2 db "x = %d",0
.data?
x dd ?
.code
start:
invoke crt_printf,ADDR text1
invoke crt_scanf,ADDR format1,ADDR x
invoke crt_printf,ADDR format2,x
invoke ExitProcess,0
END start
[attachment deleted by admin]