1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include<iostream>
#include<string>
#include <sstream>
using namespace std ;
int abee1 [4] [4] = {{5,0,40,30},{6,0,21,47},{7,0,17,63},{8,0,31,62}};
int abee2 [4] [4] = {{1,0,37,52},{2,0,49,49},{3,0,52,64},{4,0,20,26}};
int main()
{
int cc;
for ( cc = 1 ; cc < 3; cc++)
// making the name of nbee1 and nbee2
{ string String = static_cast<ostringstream*>( &( ostringstream () << cc) )->str();
string arrayname = "abee" + String;
// using pointer to have the values of nbee1 or nbee2
string *a = & arrayname;
for ( cc = 0 ; cc < 4; cc++)
cout << *a<<"\n";
}
return 0;
}
|