I am having trouble deleting the memory i create in a struct. I created a desstructor to do the work but it crashed after it stores it into my link list.
Code:
// Globals
struct menu
{
char* name;
unsigned int numOptions;
struct option
{
char* name;
bool isMenu;
char* fileName;
};
option* theOptions;
menu(void) { theOptions = NULL; }
~menu(void) { delete [] theOptions; }
};
// Prototypes
const menu getMenu(const char* fileName);
void showMenu(const menu& theMenu, unsigned int currentSelection = 0);
void gameLoop(void);
int main(void)
{
SLList<menu> menus;
menus.addHead(getMenu("main.mnu"));
gameLoop();
return 0;
}
I am having trouble debugging this one. I don't need an answer on how to fix it, just need a clue as to where to look