Talking about C++ aren't you??? So why do you use calloc instead of new ??? it produces hardly readable code and has no avantages in your case since you initialize all the items of your array!