The C2248 error that you're seeing from the Visual C++ compiler is because CNiIIRCascadeFilter's default constructor is private, hence it cannot be called when the array is allocated. Here is one way that you can work around this:
int i = 0;
const int count = 27;
CNiIIRCascadeFilter** filters = new CNiIIRCascadeFilter*[count];
for (i = 0; i < count; ++i)
filters[i] = new CNiIIRCascadeFilter(CNiMath::LowPass, 3);
// Use the array ...
for (i = 0; i < count; ++i)
delete filters[i];
delete filters;
There are other ways you could implement this to be more defensive and to ensure that delete is called. For example, you could use an
STL vector of smart pointers such as
boost.org's
shared_ptr.
- Elton