My application is crashing when I try and delete an array I created.
I can't figure out why? Can anyone help?? See lines 5 and 13 below.
Also at line 4 should I initialize my pointer to null?


1 bool CNameDialog::OnPerformSelect(void)
2 {
3 bool Result=true;
4 int *iArrayOfIndex;
5 iArrayOfIndex = new int[iCount];
6 Result=CheckName();
7 if(Result)
8 {
9 // Use iArrayOfIndex as an array
10
11 }
12
13 delete [] iArrayOfIndex;
14 return Result;
15}