Code:Hello every one Im having a trouble with an Inventory Class Im getting a HEAP CORRUPTION ERROR. After I compile a window appers saying: HEAP ERROR DETECTD: AFTER nORMAL BLOCK (#135) AT 0X00474860. CRT DETECTED THAT THE APPLICATION WROTE TO MEMORY AFTER END OF HEAP BUFFER Here is the code: //InventoryItem.h //This class has a private member function #ifndef INVENTORYITEM_H #define INVENTORYITEM_H #include<cstring> //needed for strlen and strcpy //Constant for the descrptions default size const int DEFAULT_SIZE = 51; class InventoryItem { private: char *description; //The item description double cost; //The item cost int units; //Number of units on hand //Private Member function. void createDescription(int size, char *value) {//Allocate the default ammount of memory fir description. description = new char [size]; //Store a value in the memory. strcpy(description,value);} public: //Constructor #1 InventoryItem() {//Stotre an empty string in the description of the //atribute createDescription(DEFAULT_SIZE, ""); //Initialize cost and units cost = 0.0; units = 0; } //Contructor#2 InventoryItem(char *desc) {//Allocate memory and store the description. createDescription(strlen(desc),desc); //Initialize cost and units cost = 0.0; units = 0;} //Constructor#3 InventoryItem(char *desc,double c,int u) {//Allocate memory and store the description createDescription(strlen(desc),desc); //Asssign Values to the cost and units cost = c; units = u;} //Destructor ~InventoryItem() {delete [] description;} //Mutator Functions void setDescription(char *d) {strcpy(description,d);} void setCost(double c) {cost = c;} void setUnits(int u) {units = u;} //Accesor Functions const char *getDescription()const {return description;} double getCost() const {return cost;} int getUnits () const {return units;} }; #endif //InventoryItem.cpp //This program demonstrates an array of class object #include<iostream> #include<iomanip> #include "InventoryItem.h" using namespace std; int main() { const int NUM_ITEMS = 5; InventoryItem inventory[NUM_ITEMS] = { InventoryItem("Hammer",6.95, 12), InventoryItem("Wrench",8.75, 20), InventoryItem("Pliers",3.75, 10), InventoryItem("Ratchet",7.95, 14), InventoryItem("Screwdriver",2.50, 22) }; cout<<setw(14)<<"Inventory Item" <<setw(8)<<"Cost" <<setw(16)<<"Units on Hand\n"; cout<<"-------------------------------------\n"; for (int i = 0;i< NUM_ITEMS;i++) { cout<<setw(14)<<inventory[i].getDescription(); cout<<setw(8)<<inventory[i].getCost(); cout<<setw(7)<<inventory[i].getUnits(); } return 0; } /*'Inventory Class.exe': Loaded 'C:\Users\RKLO\Documents\Visual Studio 2010\Projects\Inventory Class\Debug\Inventory Class.exe', Symbols loaded. 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded. 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded. 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Symbols loaded (source information stripped). 'Inventory Class.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Symbols loaded (source information stripped). The thread 'Win32 Thread' (0x19bc) has exited with code -1073741510 (0xc000013a). The program '[5892] Inventory Class.exe: Native' has exited with code -1073741510 (0xc000013a). */ //ANY HELP IS REALLY APPRECIATED // I UPLOADED THE CODE FOR YOUR BENEFIT