Hi im trying to print out rows and columns using ascai characters to resemble pixels. I am trying to get the user to input the dn values for the array and then use these values to then print out the appropriate character. Im really stuck now and have been at this for days any help would be great as i have to hand this in today. Heres my code below thankyou
#include <iostream>
using namespace std;
const int PIXEL_1 = 177;
const int PIXEL_2 = 176;
const int MAXROWS = 3 , MAXCOLUMNS = 3;
void initalise (int pixel_array[][MAXCOLUMNS], int size_of_first_dimension);
void print_array ();
int main ()
{
int num_array [MAXROWS][MAXCOLUMNS];
cout << " Please enter the DN values for num_array [0],[0]." << endl;
int dn_value;
cin >> dn_value;
initalise (num_array, MAXROWS);
for (int row = 0; row < MAXROWS; row++)
{
for (int column = 0; column < MAXCOLUMNS; column++)
{
cout << num_array[row][column] << char ( PIXEL_1 );
}
cout << endl;
}
return 0;
}
void initalise (int this_array[][MAXCOLUMNS], int size_of_first_dimension)
{
int i = char ( PIXEL_1 ), j = char ( PIXEL_2 );
for (i = 0; i < size_of_first_dimension; i++)
for (j = 0; j < MAXCOLUMNS; j++)
{
this_array[i][j] = char ( PIXEL_2 );
}
}