Hi folks,
how can I copy an multidimensional array? I just found "slices", but that just works on 1d-arrays...
how can I copy an multidimensional array? I just found "slices", but that just works on 1d-arrays...
The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.
' create and fill source array Local array:Int[10,10] Local i:Int,n:Int,c:Int For i=0 Until 10 For n=0 Until 10 c:+1 array[i,n] = c Next Next ' create new array and copy contents of the source array into it Local copy:Int[10,10] MemCopy(copy,array,SizeOf(array)) ' prove contents are correct Local l$ For i=0 Until 10 For n=0 Until 10 l$:+copy[i,n]+" " Next l$:+"~n" Next Print l