Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Test/ArrayTst.cpp

Go to the documentation of this file.
00001 // Test of class Array (of integers)
00002 
00003 #include <j2k/Fred/Math/Array.cpp>
00004 
00005 /*************************************/
00006 /***  Use same as if it was:       ***/
00007 /***  __J2K__Defined_Array_##NAME  ***/
00008 /*************************************/
00009 #ifndef __J2K__Defined_Array_int
00010 #define __J2K__Defined_Array_int
00011   MC_ClassDef_Array(  int, int )
00012   MC_ClassImpl_Array( int, int, 10, 0 )
00013 #endif
00014 
00015 void main() {
00016   Array_int  a( 10 );
00017   Array_int* b = new Array_int( 3 );
00018   Array_int* c = NULL;
00019 
00020   cout << a.getSize()  << endl;
00021   cout << b->getSize() << endl;
00022 
00023   for( int i = 0; i < 10; i++ ) {
00024     a[i] = i;
00025     if ( i < 3 ) {
00026       (*b)[i] = i;
00027     }
00028   }
00029 
00030   c = &a;
00031 
00032   cout << ( a == *b ) << endl;
00033   cout << ( a != *b ) << endl;
00034 
00035   cout << ( a == *c ) << endl;
00036   cout << ( a != *c ) << endl;
00037 
00038   cout << a << endl;
00039   cout << *b << endl;
00040   cout << *c << endl;
00041 
00042   cout << a.getArrayCount() << endl;
00043 
00044   cin >> *c;
00045   cout << *c;
00046 
00047 }

Generated on Sun Oct 14 18:46:17 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001