4 ms·
Uh, this is a few years old, and perhaps the author was learning as they went. Still, I think this passage is a bit too much: Quick refresher: a pointer is a l
by unwind 4y ago
Uh, this is a few years old, and perhaps the author was learning as they went. Still, I think this passage is a bit too much:
Quick refresher: a pointer is a location in memory aka a memory address. That memory address can contain anything: an integer, a float, the middle of a string. It can also store the name of a function, also known as its label. A function’s name is its address in memory.
A pointer is not a location in memory. A pointer is a type of value, that represents a location in memory. It certainly cannot hold the name of a function, since names are not locations (also, in C there are no names at run-time typically).
It can hold the location of a function, which is represented symbolically in C by its name. These names are not called labels in C, that is a common term in assembly though.
- actionfromafar 4y agoIf you come at it from an assembly perspective, the explanation makes a lot of sense IMHO. But it could use a qualifier that the "name" is just a number and not the actual name as in the source code.