Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
double x;
string s;
double* A;
int** M;
string** W;
| expression | type |
x | |
s | |
A | |
M | |
W | |
x[0] | |
s[0] | |
A[0] | |
M[0] | |
W[0] |
| expression | type |
x[0][0] | |
s[0][0] | |
A[0][0] | |
M[0][0] | |
W[0][0] | |
x[0][0][0] | |
s[0][0][0] | |
A[0][0][0] | |
M[0][0][0] | |
W[0][0][0] |
. Write a complete definition of function print_col
that could be called like this print_col(A,5,4,1) (assuming the
above situation) to print the index 1 column of the array A. Thus, the call
print_col(A,5,4,1) would produce the output shown below.
1 11 21 31 41 Note: the function should work for any 2D array of ints with proper dimensions and any column number.
| |
Bring to class