I need to create an array of objects when I click a button in Visual C++. I am having some difficulty doing so. Any help would be appreciated.
---Code within button click---
When I run it, it gives me an error about an unhandled exception.Code:PictureBox* picBlocks[]; for(int i = 0; i < 5; i++) { picBlocks[i] = new PictureBox(); pnlGameField->Controls->Add(picBlocks[i]); }
Debug stops at the last line of code. I'm still quite a beginner, so I'm not exactly sure what to look for.
Thanks