using tables as arguments in c++/c

#include <iostream>

// Function prototype
void processTable(int table[][3], int rows, int columns);

int main() {
    // Example table
    int myTable[2][3] = {{1, 2, 3}, {4, 5, 6}};

    // Call the function with the table as an argument
    processTable(myTable, 2, 3);

    return 0;
}

// Function definition
void processTable(int table[][3], int rows, int columns) {
    // Nested loops to iterate through the table
    for (int i = 0; i < rows; ++i) {
        for (int j = 0; j < columns; ++j) {
            // Access and print each element in the table
            std::cout << table[i][j] << " ";
        }
        // Move to the next row
        std::cout << std::endl;
    }
}