Nether Pointer Memory

This is a very simple question. I just wanted to know what would be in the memory of a void type pointer.

Any help is really determined. Thank!

+3
source share
4 answers

A voidPointer is simply a value that provides an address in memory. What is actually indicated by the pointer voidcannot be determined without additional information.

As for the memory occupied by the pointer void, this will be a 32-bit value for a 32-bit architecture and a 64-bit value in a 64-bit architecture (etc.).

The interpretation of this value is very dependent on the underlying architecture and how it implements memory addressing.

+7
source

- , , void ...

0

void - , .

Accordingly, if you have void *foo, C will not allow you to read *foo, not to mention assigning it some value.

Therefore, the answer to your question is: you cannot find out the value of the pointer void. You must point the void pointer to some other type, and the value at the address pointed to by the new pointer is interpreted according to its type.

0
source

Actually, this is also a pointer, so the size should be equal to ordinary pointers.

0
source

All Articles