If p is pointer to an integer and tis a pointer to a character then si...
Pointer to an integer and pointer to a character are equivalent when the context of size of operator is used.
View all questions of this test
If p is pointer to an integer and tis a pointer to a character then si...
Explanation:
In C, the size of a pointer is dependent on the underlying system architecture. On most modern systems, a pointer occupies 4 bytes or 8 bytes (32-bit or 64-bit architecture respectively). However, the size of the data type being pointed to by the pointer is independent of the pointer itself.
Size of p:
Since p is a pointer to an integer, the size of p will be the same as the size of any other pointer on the system (4 bytes or 8 bytes).
Size of t:
Since t is a pointer to a character, the size of t will also be the same as the size of any other pointer on the system (4 bytes or 8 bytes).
Comparison:
Therefore, the size of p and t is the same, regardless of the type of data they are pointing to. The size of the data type itself (integer or character) is not relevant when determining the size of a pointer.
Conclusion:
Hence, the size of (p) is the same as the size of (t), making option A the correct answer.