the size of a char pointer in a 32-bit processor is 4 bytes, while the size of a char pointer in a 64-bit processor is 8 bytes. 1) no matter char variable, int, float all size are same 0x0A etc. the size of the character pointer is 8 bytes. Note: This code is executed on a 64-bit processor. 2) Array Since each element of the array is stored in a particular memory location, there must be a pointer storing the address of these elements. As an array is a contiguous memory block, the elements in an array are also present in adjacent memory locations, that is, in 2000, 2001 (=2000+1), 2002 (=2000+2), 2003 (=2000+3), 2004 (=2000+4). 3) Size of a Pointer to an Array The size of a pointer to an array is 8 bytes as *p=arr; 5) To find the number of elements in an array: sizeof(arr)/sizeof(arr[0]));
To embed this program on your website, copy the following code and paste it into your website's HTML: