I read the dynamic array and use it, but i have a bit question: When i put following format in prototype:
void mmyfunc(int *& myArray)
{
//implementation
}
1.if i pass an array to it, how to call it? because i get :
no matching function for call to
2.When i use the following implementation :
void NetworkSocket::resizeArray (int *&orig, int index, int size)
{
int *resized = new int[size];
for (int i = 0; i < size; i++)
{
if ( i == index )
i++;
resized[i] = orig[i];
}
delete [] orig;
orig = (int *)new int[size];
orig = resized;
}
i get seg fault in delete [] line.
std::vector.