|
-
June 28th, 2002, 10:34 AM
#1
delete [] problems
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}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|