Showing posts with label dynamic allocation. Show all posts
Showing posts with label dynamic allocation. Show all posts

Monday, June 16, 2014

Dynamic allocation

Dynamic allocatonThese variables are created when we need'em and then they must be deleted. 
notice that these variables are generated during the excution time not in the compiling time as the other variables.Creating a new variable : 
eg : int * xPtr = new int ; 
eg : char * NamePtr = new char[17] ;Deleting it : 
eg : delete xPtr; 
eg : delete [17] NamePtr ;