1 votes 1 votes pls explain why option d is wrong ? Programming in C programming-in-c pointers + – set2018 asked Aug 9, 2017 set2018 739 views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply set2018 commented Aug 9, 2017 i edited by set2018 Aug 9, 2017 reply Follow Share #include<stdio.h> int main() { int a = 10; void *ptr = &a; printf("%d", sizeof(ptr)); return 0; } output =8 how ? 0 votes 0 votes set2018 commented Aug 9, 2017 reply Follow Share size of pointer is depend on machine /compiler. size of pointer is is equal to sizeof(int), wht is correct approach ? 0 votes 0 votes joshi_nitish commented Aug 10, 2017 reply Follow Share conventionally sizeof every pointer(including void pointer) is equal to the sizeof largest primitive data type in that system.. since largest primitive data type is double and sizeof(double)=8 bytes....therefore sizeof any pointer(including void) will be 8. in your above qsn all options are incorrect.. 0 votes 0 votes set2018 commented Aug 10, 2017 reply Follow Share any reference ? 0 votes 0 votes joshi_nitish commented Aug 10, 2017 reply Follow Share https://stackoverflow.com/questions/3520059/does-the-size-of-pointers-vary-in-c 0 votes 0 votes set2018 commented Aug 10, 2017 reply Follow Share @joshi_nitish According to this the size of a pointer is platform dependent Pointer is a memory address - and hence should be the same on a specific machine. 32 bit machine => 4Bytes, 64 bit => 8 Bytes. Hence irrespective of the datatype of the thing that the pointer is pointing to, the size of a pointer on a specific machine would be the same but again my doubt is in this case why option c right ? 0 votes 0 votes Anmol Verma commented Aug 13, 2017 reply Follow Share See this: https://stackoverflow.com/questions/3853312/sizeof-void-pointer 0 votes 0 votes Please log in or register to add a comment.