int boxMax = 5;


Box *box = new Box[boxMax];


boxMax = 0;


for(...)

{

box[boxMax] = 1;

boxMax++;

}


delete[] box;


이렇게 해도 아무런 이상없음?