Not getting Errors but keep getting BreakPoint

Hello, I am new to C++ programming, use this site everyday when coding and it is very helpful. I can usually search and find my issues but this time I can not.

I don't seem to be getting any errors, but at the end of testing my code I keep getting a Break Point. It doesn't show me any errors and I cant seem to figure out the issue or a way to fix the issue.

If you could please lend me your knowledge, I would appreciate it. Here is the code below.

1
2
3
4
5

	Planes* pointer = new Planes[];

	string month[] {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "Novemeber", "December"};
Last edited on
Actually there appears to be at least one error in your code:

In function 'int main()': 27:31: error: expected primary-expression before ']' token
Thank you Very Much. I THINK I found the solution because of your post. For some reason my compiler was not giving me any errors. Here is what I have changed.

1
2
3
Planes* pointer = new Planes[12];

	string month[12] {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};


I declared the arrays to have 12 elements instead of letting them be open.

Is this the only error you noticed?
Is there any other way I could have solved this issue?



I will be changing the original post to solved shortly. Giving a little bit of time, hoping others might find different issues or possibly a different solution to mine. Thanks.
Last edited on
Only the first line needs to be changed.

This is because new[] needs to know how large of a memory block to ask for at runtime, but the number of elements in the array months[] can be deduced by the compiler.
Last edited on
Topic archived. No new replies allowed.