array2d.cpp
/**
 * @brief Print out a 2D array
 * 
 * @param arr Pointer to a 2D array
 * @param M Number of rows in the array
 * @param N Number of columns in the array
 */
@brief Print out a 2D array

@param arr Pointer to a 2D array
@param M Number of rows in the array
@param N Number of columns in the array
@brief Print out a 2D array @param arr Pointer to a 2D array @param M Number of rows in the array @param N Number of columns in the array
void printArray(int** arr, int M, int N) {
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < N; j++) {
            printf("======");
        }
        printf("=\n");
        for (int j = 0; j < N; j++) {
            printf("|%4d ", arr[i][j]);
        }
        printf("|\n");
    }
    for (int j = 0; j < N; j++) {
        printf("======");
    }
    printf("=\n\n");
}
void printArray ( int * * arr , int M , int N ) { for ( int i = 0 ; i < M ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) { printf ( " " ) ; } printf ( " \n " ) ; for ( int j = 0 ; j < N ; j ++ ) { printf ( " " , arr [ i ] [ j ] ) ; } printf ( " \n " ) ; } for ( int j = 0 ; j < N ; j ++ ) { printf ( " " ) ; } printf ( " \n \n " ) ; }
@brief Print out a 2D array
@brief Print out a 2D array