0
size of array and memory
Just so i understand this alittle better. If an array is addressing memory space how big is an array size of 1? If i have misunderstood please dont troll me but please correct me in my understanding thank you
2 Antworten
+ 3
An array of size 1 is 1 byte. If you are talking about an array with one element, then the sizeof the array would be the sizeof the type, such as int, bool, double, etc.
+ 2
As far as i know, every pointer i have observed with the debugger till now are 4 bytes big, so an array of size 1 (that contains a pointer to a memory) is 4 bytes. I once read somewhere pointers of 8 bytes (when researching about qt or void *) but i don't have any knowledge about that.