So I have this code that is meant to print out an array filled with random numbers in a square grid with the outside edges being zeroes (to make a black border).
I thought I had everything programmed correctly but it doesn't print out the arrays, I just get a bunch of random symbols and weird spacing. I feel like there is just a small error I'm not noticing. Here is what I have.
#include <iostream>
#include <string>
#define ROWS 12
#define COLS 10
#define HIGHEST_NUMBER 255
#define LOWEST_NUMBER 0
using namespace std;
void image_print(unsigned char image[][COLS], int nRows){
for (int r = 0; r < nRows; r++){
for (int c = 0; c < COLS; c++)
cout << image[r][c] << endl;
}
}
int main() {
srand(8); //random number seed
unsigned char Original_Image[ROWS][COLS];
int row, col;
for (row = 0; row < ROWS; row++) { //fills everything with zeroes
for (col = 0; col < COLS; col++) {
Original_Image[row][col] = 0;
}
}
cout << "Original :" << endl;
image_print(Original_Image, ROWS);
}