is there a function that returns the number of elements of an array of strings?? if not, how do i get the number of elements??, here is an example:
i define an array of strings:
string itembuy[]={"axe","potion"};
obviously it has 2 elements, but lets say i can erase or add elements , and im constantly printing the content of this array with a for loop, so i need to know the number of elements to put in the testing statement of the for so i can print the whole content without getting out of the bounds of the array...
Objects always have the same size. As do pointers, ints, floats, etc. So an array of anything will always have same-size elements.
The data itself may use differing amounts of memory, but the data is not stored directly in the array. Rather it is stored on the heap (where stuff you get from new() is kept) or in the read-only data segment (where stuff like "Hello world!" is kept).