If I had to take a guess it's probably because you're using the new operator on an array that has an undefined size. Try something like Point points[0]; // Initialize the SIZE of the array(or however many elements it can hold) to zero. Then again you are assign an array size to a class which could be the problem.