can someone tell me how to copy a 2 dimensional array to a 1 dimensional one? Ie.
array:
{2, 3, 5}
{4, 7, 9}
should become {2, 3, 5, 4, 7, 9}
Name:
Anonymous2007-01-17 13:45
>>16
Yes C has dynamic arrays. You can resize arrays stored on the heap, but no one likes to do that because you might have to shift stuff around.
>>13
Maintaining an array of pointers to each of the rows is just an extra level of indirection (to make indexing "nicer"), and doesn't effect how the array is stored: you would still have a rows * cols sized array sequentially stored and still flat. Otherwise how could you still have random access? That's basically what I mean.