/*I want to load arrays and display arrays that will have numbers 1-25 in this format
1 2 3 4 5
6 7 8 9 10
11 12 and so on...
i have got 2 functions
1st one will load arrays n second one will display */
Code:
void loadArray()
{
int r, c, cnt=1;
for( r=0; r<5; r++ )
for( c=0; c<5; c++ )
data[r][c] = cnt++;
}
void displayArray( )
{
int r, c, temp;
cout << "The 5 x 5 2D array:\n\n";
for (r=0;r<5;r++)
{
for(c=0;c<5;c++)
{
cout << " " << data[r][c];
}
}
displayArray();
getchar();
pause();
}
//i want to display arrays when ever i call func DisplayArrays();