ASDV-Cpp/Assignments/CppApplication_Pointers/twoDArrays.h

30 lines
826 B
C

//
// Created by caleb on 3/15/24.
//
#ifndef CPPAPPLICATION_POINTERS_TWODARRAYS_H
#define CPPAPPLICATION_POINTERS_TWODARRAYS_H
/** Create a 2D dynamic array and return it.
Use indexes in creation*/
int** create2Darray1( int rows, int columns);
/** Create a 2D dynamic array and return it.
Use offset in creation*/
int** create2Darray2( int rows, int columns);
/* Populate the 2D array with arbitary integers using a loop*/
void populate( int** pp, int rows, int columns);
/*Traverse the 2D array using indexes inside a loop*/
void traverse( int** pp, int rows, int columns);
/*Traverse the 2D array by dereferencing the pointers inside a loop*/
void traverse1( int** pp, int rows, int columns);
/** Free the memory the 2D array*/
void freeMemory( int** pp, int rows);
#endif //CPPAPPLICATION_POINTERS_TWODARRAYS_H