in Programming in C edited by
657 views
3 votes
3 votes
what wil be sizeof(void)

and sizeof(void *)
in Programming in C edited by
657 views

1 Answer

0 votes
0 votes
void is datatype which has size of 1 Byte like char, but void* is a pointer it is called as raw pointer. normally in c size of integer pointer is 2 byte but it depends upon the machine architecture. (i.e on 64 bit system it will be 8 Byte)
edited by

4 Comments

@Joshi That is not true. In C long double is there which is of size 10 bytes. But sizeof pointer is not related to size of any other type. On 64-bit system, it is of size 8 bytes which is the norm today. But a 32 bit compiler can also run on a 64-bit system in which size of a pointer will be 4 bytes. Some 3rd grade colleges still have systems which runs only 16-bit compilers  (who gave them Engineering college status? :O) and the result is such websites which you can see in some comment above.
2
2
ok sir, thanks!
0
0
i think it is machine dependent !
0
0

Related questions