Hello
Let's assume, that we have a string array : string[] sa;
I fill up the array with random strings with random lengths.
I want to know how much space it occupies in memory.
I could go over the string array using a for loop, then another loop for each character, and then sum up char.sizeof. But this would be very slow and inefficient.
Is there a better way? I want a method that works for every variable type including classes and objects.
Thank you