Files Classes Functions Hierarchy
00001 #include <array2Dtest.h> 00002 00003 #include <string> 00004 using namespace std; 00005 00006 #include<array2D.h> 00007 00008 class array2DtestName 00009 { 00010 public: 00011 string nm; 00012 }; 00013 00014 void array2Dtest01() 00015 { 00016 cout << "Demo of iterating over a 2D array." << endl; 00017 array2D<array2DtestName> z(2,3); 00018 z.get(0,0).nm = "a"; 00019 z.get(0,1).nm = "b"; 00020 z.get(0,2).nm = "c"; 00021 z.get(1,0).nm = "d"; 00022 z.get(1,1).nm = "e"; 00023 z.get(1,2).nm = "f"; 00024 00025 string s; 00026 for (uint i=0; i<2; ++i) 00027 { 00028 for (uint k=0; k<3; ++k) 00029 { 00030 s += z.get(i,k).nm; 00031 } 00032 } 00033 00034 cout << SHOW(s) << endl; 00035 00036 } 00037 00038
1.5.8