What does the size of a C pointer depend on? Is it the width of the data bus, the width of the address bus, or the word size of the CPU?
I believe it should depend on width of the address bus since a pointer has to address that many locations. Am I right?
(I am looking for a reason for dependency , if any)
It depends on the CPU architecture in question. You can write portable code that takes this into consideration by using
intptr_t(C99 only).