First page Back Continue Last page Graphics
Class Templates cont.
Stack of pointers? It is the calling program's job to create the pointers, the stack only manages them!
Prata: Plodson example (stckp1.h,stkoptr1.cpp)
Non-Type arguments
- template <class T, int n>
- class ArrayTP
- {
- private:
- T ar[n];
Sample instantiation:
- ArrayTP<double, 12> eggwhites;