not fully filling a 2 dimensional array
Out of curiosity. Is there a way to fill a 5x5 array with only 5 characters?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
#include <ctime>
using namespace std;
void fill(char ar[][5], int size);
void print(char ar[][5], int size);
int main()
{
int ar[5][5];
return 0;
}
void fill(char ar[][5], int size)
{
for (int col = 0; col < size; col++)
{
for (int row = 0; row < size; row++)
{
}
}
}
void print(char ar[][5], int size)
{
for (int col = 0; col < size; col++)
{
for (int row = 0; row < size; row++)
{
}
}
}
| |
I really don't know how to fill it or print it out. I mean if it is possible.
Last edited on
You could make the other 20 positions null, or 0...
Topic archived. No new replies allowed.