Re: [Dev-C++] How do I declare a template class variable and make an instance seperately?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Richard V. W. <ric...@ai...> - 2005-11-07 07:08:25
|
Hi, You are creating an object called B, but there is no default constructor for the class (a constructor with no parameters). The only constructor takes an int parameter. As I see it you want to be able to modify the heap size dynamically, So maybe you can add a method called SetHeapSize(int i) that takes care of assigning or freeing memory, and this can be called anytime. You can only create an object once. Another aproach.. Not sure about template classes, but perhaps you can declare a POINTER to an object and call it B and Create the object later on using 'new'. Cheers, Richard |