What-is-the-size-of-a-pointer-in-C? tccicomputercoaching.com The size of a pointer depends on many factors - including the CPU architecture, compiler, Operating System etc. It depends on which compiler you are using. If you are using 16 bit it will be 2. If you are using 32 bit it will be 4. If you are using 64 bit it will be 8.
It is common to all the data types (*int,*char,*flaot, etcâ&#x20AC;Ś). 1. #include <stdio.h> 2. int main() 3. { 4. int *ip; 5. print(â&#x20AC;&#x153;pointer size: %zu\nâ&#x20AC;?, sizeof(ip)); 6. } 7. > cc -o pointersize pointersize.c 8. > ./pointersize 9. pointer size: 8 10. > cc -m32 -o pointersize pointersize.c 11. > ./pointersize 12. pointer size: 4