/********************************************************************** * main.cc * A small program to demonstrate the use of a template-based array * class. **********************************************************************/ #include #pragma implementation #include "array.h" /********************************************************************** * main() **********************************************************************/ int main() { Array a(5); // array of 5 ints. int i; Array b(2); // array of 2 char*'s. char *s; a.Set(12, 0); a.Set(35, 1); a.Get(i, 0); cout << i << endl; a.Get(i, 1); cout << i << endl; cout << "Size: " << a.Size() << endl; cout << "\n==========\n\n"; b.Set("Hello", 0); b.Set("World", 1); b.Get(s, 0); cout << s << endl; b.Get(s, 1); cout << s << endl; cout << "Size: " << b.Size() << endl; return 0; }