Refering to http://www.devx.com/tips/Tip/13291, it says that I can use memcpy with the size to copy determined by sizeof(), however, isn’t the array pointing to a pointer?
Other than iterating through the array, how can I use memcpy to deep copy an array?
Thanks!
A multi-dimensional array is contiguously allocated. An array of pointers (of pointers…) is a different thing (and each sub-pointer should be allocated/copied/freed on its own).
Do not be confused by the fact that an unidimensional array and a single pointer can be used interchangeably in most situations, because they are not technically the same.