Hello,
I am trying to wrap my head around class templates.
I have an array but do not know how to implement with a template class.
Before Template:
After TemplateCode:class Foo { public: Bar() { ...; } private: ... }; int main() { Foo *Array[10]; Array[0] = new Foo; Array[0] -> Bar(); };
Code:template <class T> class Foo { public: Bar() { ...; } private: ... }; int main() { Foo<What Do I put Here> *Array[10]; // Or is the even the correct syntax? Array[0] = new Foo; Array[0] -> Bar(); };