I am trying to print an array with specific dimensions, but it prints out wrong entities when it's run.
//code
#include <stdio.h>
int my_array[2] [4] = {
{1, 2, 3, 4}, {5, 6, 7, 8}
};
void print_array(const int h, const int w, char array[][w]) {
int nRow = h;
int nColumn = w;
for(int i = 0; i < nRow; i++) {
printf("--- Row %d --- \n", i);
for(int j = 0; j < nColumn; j++) {
printf("Column [%d] = %d \n", j, array[i] [j]);
}
}
}
int main(int argc, char **argv)
{
const int array_width = 4;
const int array_height = 2;
print_array(array_height, array_width, my_array);
return 0;
}
After compiling it prints out the next result:

char array[][w]should beint array[][w]charandintand your guesses what they are. The question is not world class, but it is not off-topic. So you should even be safe from downvotes by people from the "good answers to off-topic questions are bad answers" clan.