Foreach loop for struct of arrays

In reply to Prathyusha Sandilya:

Hi, Would it be possible to post your fixed code with the memory allocation ? I’m trying out a couple of things, but i’m unable to allocate memory using the new operator inside a class.

I’m able to do it in a module, but not in a class.