cs162/assignments/assignment1/magic.cpp
/*********************************************************************
 * ** Function: delete_info
 * ** Description: This function deletes all of the main arrays
 * ** Parameters: wizard *wiz, int num_wizards, spellbook *spells, int num_books
 * ** Pre-Conditions: the entire program has run correctly and the arrays need to be deleted now
 * ** Post-Conditions: arrays deleted
 * *********************************************************************/
delete_info
Description: This function deletes all of the main arrays
Parameters: wizard *wiz, int num_wizards, spellbook *spells, int num_books
Pre-Conditions: the entire program has run correctly and the arrays need to be deleted now
Post-Conditions: arrays deleted
delete_info Description : This function deletes all of the main arrays Parameters : wizard * wiz int num_wizards spellbook * spells int num_books Pre - Conditions : the entire program has run correctly and the arrays need to be deleted now Post - Conditions : arrays deleted
void delete_info(wizard *wiz, int num_wizards, spellbook *spells, int num_books) {
	delete [] wiz;
	wiz = NULL;
	for(int i = 0; i < num_books; i++) {
		delete [] spells[i].s;
	}
	delete [] spells;
	spells = NULL;
}
void delete_info ( wizard * wiz , int num_wizards , spellbook * spells , int num_books ) { delete [ ] wiz ; wiz = NULL ; for ( int i = 0 ; i < num_books ; i ++ ) { delete [ ] spells [ i ] . s ; } delete [ ] spells ; spells = NULL ; }
** Function: delete_info
 ** Description: This function deletes all of the main arrays
 ** Parameters: wizard *wiz, int num_wizards, spellbook *spells, int num_books
 ** Pre-Conditions: the entire program has run correctly and the arrays need to be deleted now
 ** Post-Conditions: arrays deleted
** Function : delete_info ** Description : This function deletes all of the main arrays ** Parameters : wizard * wiz int num_wizards spellbook * spells int num_books ** Pre - Conditions : the entire program has run correctly and the arrays need to be deleted now ** Post - Conditions : arrays deleted