1,612 views
3 votes
3 votes
#include<stdio.h>
int main()
{
    int a = 10;
    void *ptr = &a;
    printf("%d", sizeof(ptr));
    return 0;
}
output =8

how ?if we know size of pointer is already machine dependent then in this case ptr is referring a address of int  then how output 8 ?

Please log in or register to answer this question.

Related questions

1 votes
1 votes
2 answers
3
0 votes
0 votes
1 answer
4
Gurdeep Saini asked Feb 1, 2019
613 views
is it dangling pointer ?int main(void) { int* p;printf("%d",*p); return 0;} https://ideone.com/IN77el