Minggu, 04 Desember 2011

struktur data program array2d

0 komentar
source code c++:
// test 2D array class

#include <iostream.h>
#include <conio.h>
#include "array2d.h"


void main(void)
{

   try {
      int i, j;
      Array2D<int> X(2,2);
      for (i = 0; i < 2; i++)
         for (j = 0; j < 2; j++)
            X[i][j] = 0;

      cout << "X is" << endl;
      cout << X << endl;

       X.IsiMatrix(1,2,3,4);
      cout << "X is" << endl;
      cout << X << endl;

     }
   catch (...) {
      cerr << "An exception has occurred" << endl;}

      getch();
}
hasil:

Leave a Reply

Labels