memcopy

What are the implications of performing a shallow copy on an array in order to resize it?

If my understanding of deep and shallow copying is correct my question is an impossible one. If you have an array (a[10]) and perform a shallow copy (b[20]) wouldn't this be impossible as the data in b wouldn't be contiguous? If i've got this completely wrong could someone advise a fast way to immitate (in c#) c++'s ability to do a real...

What is the fastest way to copy my array?

I'm doing some Wave file handling and have them read from disk into an array of bytes. I want to quickly copy portions from this byte array into another buffer for intermediate processing. Currently I use something like this: float[] fin; byte[] buf; //fill buf code omitted for(int i=offset; i < size; i++){ fin[i-offset] = (float) bu...

c++ std::pair, std::vector & memcopy

Hi! is it safe to memcopy myvect.size()*sizeof(foo) bytes from the memoryadress of the first element of a std::vector<std::pair<T1, T2> > myvect into an array of struct foo{ T1 first; T2 second; } if the array is allocated with the same number of elements as the vector's size? thanks ...