The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: av07 on September 19, 2008, 11:17:49 AM

Title: convert array to string
Post by: av07 on September 19, 2008, 11:17:49 AM
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...
Title: Re: convert array to string
Post by: BogdanOntanu on September 19, 2008, 11:41:56 AM
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?