How to Specify Array Length during Object Construction within Arduino IDE?
Another way is for the caller to provide the memory as a pointer to enough bytes for 'N' objects (cast, if necessary, as a pointer to the required type), and the number, 'N' of such objects. This gives the caller the choice of whether to allocate statically or dynamically.

It looks like you want an array of ints. So you'd allocate an array (statically, in my example, but you could choose whichever best fits your application):

int memArray[N];
// ...
myClass(N, memArray&amp;);


I avoid allocating memory from the heap, but someone else might have a different preference or a situation that requires it; this technique lets the library work for either.