Reputation: 1
I am trying to find number of characters in string taken by user.However lengthof returns me initializing size of string
This is my code , it returns 11
INCLUDE Irvine32.inc
.data
MAX = 10
stringIn BYTE MAX+1 DUP (?)
.code
main PROC
mov edx,OFFSET stringIn
mov ecx,MAX
call ReadString
call writeString
mov eax,lengthof stringIn
call writeint
main ENDP
END main
Upvotes: 0
Views: 1325
Reputation: 10371
The length of the string returns in register EAX
after calling ReadString
:
Search the text "readstring" in next example :
Upvotes: 2