4 ms·
A variable that is a pointer occupies space in memory. In that memory (the pointer of the pointer) is stored the number. char* ptr = (char*) 0x80000000; B
by scoutt 6y ago
A variable that is a pointer occupies space in memory. In that memory (the pointer of the pointer) is stored the number.
char* ptr = (char*) 0x80000000;
By doing `&ptr` you can know the address of the pointer `ptr`. In that address, the number 0x80000000 is stored.
- enriquto 6y agoI sort of disagree... The pointer can be stored in a register and it does not take memory.
- Twisol 6y agoRegisters are simply the fastest, closest kind of memory for a CPU to use. They're still memory, in that you can put something there and remember it for later.
- scoutt 6y agopointer != address Unless there is no difference between a pointer and an address, in a register you can store an address, maybe the address of a pointer (and so on). But you can be right if we talk about some registers that always point to something, like IP (PC). But we enter into a philosophic area. Edit: Yes, I know, you can also treat a register as a pointer. Should we leave it to the Wikipedia definition? https://en.wikipedia.org/wiki/Pointer_(computer_programming) https://en.wikipedia.org/wiki/Pointer_(computer_programming)