class: user defined array

i created a class called poly and i thought that the way to create a user defined array with a class was the same. im getting an error saying bad array new length
1
2
3
4
5
6
7
8
9
        int userCoe;
	int userDeg;

	cout << "Enter the degree of the polynomial: ";
	cin >> userDeg;

	cout << "Please enter " << userDeg + 1 << " terms: " << endl;
	Poly *userInput;
	userInput= new Poly[userDeg]; //<-- error 
> im getting an error saying bad array new length
¿a compilation error or a runtime error?
¿what lenght are you using?
¿why do you reserve space for `n' numbers if you need to input `n+1' numbers?
Topic archived. No new replies allowed.