oxxxo
oxooo
xxooo
ooooo
- Code: Select all
#include <iostream>
using namespace std;
int main()
{
char Map[5][5] =
{
{ 'o', 'o', 'o', 'x', 'o'},
{ 'o', 'x', 'x', 'x', 'o'},
{ 'o', 'x', 'o', 'o', 'o'},
{ 'x', 'x', 'o', 'o', 'o'},
{ 'o', 'o', 'o', 'o', 'o'}
};
int C=0,R=0;
for(C;C<(sizeof(Map)/sizeof(*Map));C++)
{
R=0;
for(R;R<((sizeof(*Map)/sizeof(**Map)));R++)
{
cout<<Map[C][R];
}
cout << endl;
}
char t;
cin>>t;
return 0;
}
Note: (sizeof(arr)/sizeof(*arr)) && (sizeof(*arr)/sizeof(**arr)) was not by me. I found it on some c++ website. ^.^
This detects how wide and tall the Array is and display's it's contents out into the console.
