3 ms·
I see having pointers to support dynamic memory allocation as something different from the ability to refer to memory addresses. For example, in C, one can [1]
by Someone 10y ago
I see having pointers to support dynamic memory allocation as something different from the ability to refer to memory addresses. For example, in C, one can [1] write a program that attempts to write data to any memory address. With Java, that is not possible. With pascal, Wirth's intention was similar, but IIRC variant records provided an undesired escape hatch.
[1] probably not without invoking implementation-dependent behavior.
- pjmlp 10y agoIn most Pascal dialects (not on the first ISO) var CrtMode: byte absolute $0040:$0049; P: ^byte; begin P := Ptr($40, $49); end