Given a pointer to the first element of an array, how can I get the size of the array? For example, if I were given a
but not arr
here:
int arr[]={1,2,3};
int* a=arr;
Also could anyone explain a bit about the properties of "\0" in the array?
- My understanding of "\0" is that it marks the end of the array. Is that correct? And is there more I should pay attention to?
- Does "\0" work for all types of arrays or only char type? If it works only for char type, are there any similar symbols for other types of arrays?
- Will '\0' be automatically inserted at the end of the array? Or it will be automatically inserted only under some specific conditions?