1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include <stdio.h>
void showStock(int a, int p, int stock[][p]);
int main( ) {
int a = 3;
int stock[][3] = {{9, 5, 6},
{8, 2, 1},
{7, 3, 4}};
showStock(a, 2, stock);
return 0;
}
void showStock(int a, int p, int stock[][p]) {
int i;
p--;//To adjust with array index.
for(i=0; i < a; i++)
printf("(%d, %d) -> %d\n", i, p, stock[i][p]);
}
|