0
Bidimensional arrays in C
How do I pass a matrix by reference (not by value I want the array to be used or modified) to a function/procedure in c?
2 Antworten
+ 3
char **matrix should do
But be careful, it is not by reference but by address
+ 1
I want to pass the matrix to this kind of function
void printStrings(char *matrix, int nWords, int stringLength){
unsigned int i, ii;
for(i=0; i<nWords; i++){
for(ii=0;ii<stringLength;ii++){
printf("%c", matrix[i][ii]);
}
printf("\n");
}
}
to print every letter of the words contained in each line of the 2D matrix on separate lines