News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

convert array to string

Started by av07, September 19, 2008, 11:17:49 AM

Previous topic - Next topic

av07

Hi
How can I convert array to string?
for example

arr1 dw 4,3,-2,0,2
string1 db 10 dup(?)


I want string1 = '4 3 -2 0 2'
wsprintf failed...

BogdanOntanu

Hi,

One possible logical solution would be to read each array element one at a time and then apply wsprintf or similar functions (dwtoa, atoi, etc) in order to print each array element...

If you know the size of each array element and the total number of elements then you could use a loop in order to print all elements of the array.

Question: is this a homework?
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro