I assume holder is a class or a struct, so it would be helpful to see the declarations...Some of the lines look suspicious:
Code:
temp.data=new person*[temp.count];
What is data exactly? It looks like you are trying to allocate space for a two-dimensional array, but this won't be enough to do so...If you are allocated a one-dimensional array get rid of the '*' in that:
Code:
temp.data=new person[temp.count];
Also, an easier way to zero out the contents of that array would be to use the memset() function.
Lastly, you will go out of bounds in your loops:
Code:
for(int k = 0; k<= temp.count; k++)
Will loop up to temp.count; unfortunately arrays start with a 0 subscript (temp.data[0]) so you should loop like so:
Code:
for (int k=0; k<temp.count; k++)