TO PASSING 2-DIMENSIONAL ARRAY TO A FUNCTION BY C PROGRAM




To passing 2-dimensional (two dimensional) array to a function by c program

#include <stdio.h>
#define M 3
#define N 5
void fstore2D(int a[][N]);
void fretrieve2D(int a[][N]);
int main(){
int a[M][N];
printf("Input data in matrix (%d X %d)\n", M, N);
fstore2D(a);
fretrieve2D(a);
return 0;
}

void fstore2D(int a[][N]){
int i, j;
for ( i = 0; i < M; ++i ){
for ( j = 0; j < N; ++j )
scanf("%d", &a[i][j]);
}
}

void fretrieve2D(int a[][N]){
int i, j;
for ( i = 0; i < M; ++i ){
for ( j = 0; j < N; ++j )
printf("%6d ", a[i][j]);
printf("\n");
}
}



1 comment:

l9l8thsw8e said...

Regardless of its complexity, we design every recreation with the intent 코인카지노 of creating the subsequent big title in the business. Gambling laws and insurance policies vary from one area to another. Some sites mentioned in this review most likely not|will not be} accessible in your area. Always do your due diligence and examine your native gambling insurance policies. In the cashier section of your Cafe Casino profile, choose your preferred payment possibility. If that's not sufficient, you can to|you possibly can} nonetheless contact the help staff any day of the year around the clock via the contact form or via reside chat.