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
|
#include <windows.h>
#include <iostream>
using namespace std;
void Print(char * Buffer, int SizeX, int SizeY)
{
for(int y=0; y<SizeY; y++)
{
for(int x=0; x<SizeX; x++)
{
cout<<Buffer[(y*SizeX)+x];
}
cout<<endl;
}
}
int main()
{
char Array1[3][3]={{'1','2','3'},{'a','b','c'},{'A','B','C'}};
char Array2[5][5]={{'1','2','3','4','5'},{'a','b','c','d','e'},{'A','B','C','D','E'},{'X','Y','Z','H','I'},{'!','@','#','$','%'}};
cout<<"\nArray1:\n-------------------------\n";
Print(&Array1[0][0],3,3);
cout<<"\n\nArray2:\n-------------------------\n";
Print(&Array2[0][0],5,5);
}
|