[Dev-C++] deleting an array properly?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Dane E. <da...@de...> - 2005-09-28 17:06:25
|
Hi, Thank you in advance for any help you can offer. I am trying to delete an array of pointer to objects and its throwing an error, which I cant figure out how to solve. The message is: --Emp_app_C(1024) malloc: *** Deallocation of a pointer not malloced: 0xbffff9f4; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable ------MallocHelp to see tools to help debug First I build my array of pointers to objects: --employee* empList[MAX_EMPLOYEES]; After populating the array, I tried to delete it using these 2 different statements: 1. delete[] empList; 2. delete empList; Please can someone show me the correct statement that would delete this array properly? Best regards, Dane Ensign |