trying to get array size as bytes with sizeof(arr).
that function supposed to return 40 (4*10) but I get 4 (for 1 int size and not for 10 times int size.
Why is that? and how can I get the real size?
I'm working wiht visual studio, maybe thats the problem?
arr is pointer pointing to the first element of array, and pointers are sizeof 4 bytes in 32 bit system and 8 bytes in 64bit system, So you are getting the size of pointer not array.
not 4 for 1 int size. you are getting 4 for 1 pointer size
Обсуждают сегодня