[ create a new paste ] login | about

Link: http://codepad.org/jsryK0L2    [ raw code | output | fork ]

C++, pasted on Nov 10:
#include <iostream>
using namespace std;

void printIntArray(const int table[][4], int numCols, int numRows)
{
    for (int k = 0; k < numRows; k++)
    {
        for (int i = 0; i < numCols; i++)
        {
            cout << table[k][i] << " ";
        }
        cout << endl;
    }
}

int main()
{
    int myIntTable[][4] = {{100, 200, 300, 10},
                         {400, 500, 600, 20},
                         {700, 800, 900, 30}};
    int numCols = 4;
    int numRows = 3;

    printIntArray(myIntTable, numCols, numRows);

    return 0;
}


Output:
1
2
3
100 200 300 10 
400 500 600 20 
700 800 900 30 


Create a new paste based on this one


Comments: