How do I get the number of elements from a pointer like this: MyClass *mc = new (nothrow) MyClass[size];
In my own code the 'size' variable depends on user input, but I don't know how to how to retrieve the number of elements of 'mc'. Or is there no other way than save the number of elements (in this case 'size') when I allocate the memory to mc?