What is the size of *p in this code?int **p;
Question
What is the size of *p in this code?int **p;
Solution
The size of *p in this code is the size of a pointer on your system. This is because *p is a pointer to an integer. The size of a pointer varies depending on the system and the compiler used, but it is typically 4 bytes on a 32-bit system and 8 bytes on a 64-bit system. You can use the sizeof operator to find out the size of a pointer on your system. For example, you can use the following code:
#include <stdio.h>
int main() {
int **p;
printf("Size of *p is: %zu bytes\n", sizeof(*p));
return 0;
}
This will print out the size of *p in bytes.
Similar Questions
What is the size of *p in this code?int *p;8 bytes16 bytes4 byte
Mark statements as T/F.True False int *p, i;char *cp, c;p = &i;cp = (char *)p;cp[2] = 'x';The last line of the above code modifies the variable i int *p; double *dp;sizeof(p) is 4 bytes while sizeof(dp) is 8 bytes. int *p;p[1] means *(p + 1) int *p; double *dp;p = p + 1 advances p by sizeof(int) bytes
What is the value of n after the following code is executed?int n = 98;int *p = &n;*p = 402;
What will be the output of the following code?int main() { int a = 10; int *p = &a; *p = 20; printf("%d\n", a); return 0;}
What is the output of the following code?int arr[] = {1, 2, 3, 4, 5};int *p = arr;p++;printf("%d\n", *p);
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.