home *** CD-ROM | disk | FTP | other *** search
- /*
- DynamoArrayTest.cpp
-
- Makes app to test out the DynamoArray template class.
- Written by Hiep Dam, From The Witches' Brew
- 12/2/95
- */
-
- #include <iostream>
- #include "Class_DynamoArray.cpp"
- #ifdef __MWERKS__
- #include <SIOUX.h>
- #endif
-
- typedef long ArrayType;
-
- void main() {
- DynamoArray<ArrayType> dArray;
- DynamoArray<ArrayType> copiedArray;
- long arrayItem;
- short i;
-
- #ifdef __MWERKS__
- SIOUXSettings.asktosaveonclose = false;
- #endif
-
- cout << "Inserting items into array:" << endl;
- for (i = 0; i <= 10; i++) {
- dArray.Append(i);
- cout << i << " ";
- }
- cout << endl << endl;
-
- copiedArray = dArray;
-
- cout << "Removing items from copied array:" << endl;
- i = 0;
- while (copiedArray.SizeOf() > 0) {
- (void)copiedArray.Remove(arrayItem, i);
- cout << arrayItem << " ";
- }
- cout << endl << endl;
-
- cout << "Randomly removing items from original array:" << endl;
- while (dArray.SizeOf() > 0) {
- (void)dArray.RandomRemove(arrayItem);
- cout << arrayItem << " ";
- }
- cout << endl;
- } // END main