Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //http://www.codeproject.com/Articles/21909/Introduction-to-dynamic-two-dimensional-arrays-in
- int **dynamicArray = 0;
- //memory allocated for elements of rows.
- dynamicArray = new int *[ROWS] ;
- //memory allocated for elements of each column.
- for( int i = 0 ; i < ROWS ; i++ )
- dynamicArray[i] = new int[COLUMNS];
- //free the allocated memory
- for( int i = 0 ; i < ROWS ; i++ )
- delete [] dynamicArray[i] ;
- delete [] dynamicArray ;
Advertisement
Add Comment
Please, Sign In to add comment