Assume int is 4 bytes, char is 1 byte and float is 4 bytes. Also, assume that pointer size is 4 bytes (i.e. typical case)
char *pChar; int *pInt; float *pFloat; sizeof(pChar); sizeof(pInt); sizeof(pFloat); |
chevron_right
filter_none
What’s the size returned for each of sizeof() operator?
(A) 4 4 4
(B) 1 4 4
(C) 1 4 8
(D) None of the above
Answer: (A)
Explanation: Irrespective of the type of pointer, the size for a pointer is always same. So whether it’s pointer to char or pointer to float, the size of any pointer would be same. Even size of a pointer to user defined data type (e.g. struct) is also would be same.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
Recommended Posts:
- C Quiz - 109 | Question 3
- C Quiz - 106 | Question 1
- C Quiz - 108 | Question 5
- C Quiz - 106 | Question 2
- C Quiz - 106 | Question 3
- C Quiz - 106 | Question 4
- C Quiz - 106 | Question 5
- C Quiz - 107 | Question 1
- C Quiz - 107 | Question 2
- C Quiz - 112 | Question 1
- C Quiz - 108 | Question 2
- C Quiz - 108 | Question 4
- C Quiz - 108 | Question 1
- C Quiz - 107 | Question 5
- C Quiz - 107 | Question 4
- C Quiz - 108 | Question 3
- C Quiz - 109 | Question 1
- C Quiz - 107 | Question 3
- C Quiz - 111 | Question 4
- C Quiz - 109 | Question 2

