Was there any pointer usage in old languages such as FORTRAN (pre Fortran-90), cobol or pascal? If not, then what is the method those languages used to implement the works done by pointers that are used in today's high level languages.
And As there is no pointers in java is there any way other way to replicate the work done by a pointer.
Algol 68 had references that were a lot like C/C++ pointers.
Pascal had pointers, though you couldn't do arithmetic on them.
PL/I had pointers.
In FORTRAN and COBOL, you mostly lived without such things as dynamic allocation written in the language. I did once write some linked-list code in FORTRAN that used an array, with an array index as the link to the "next" item (i.e., x[1] was a data item, x[2] was its link to the next data item, x[3] was another data item, and so on). Calling that "clumsy" was being almost excessively generous.
BCPL had the construct a*[b]
(which could be simplified to a!b
in our implementation, a 6809 embedded system compiler running on a 3B2 UNIX box) which was equivalent to a[b]
in C. Of course, BCPL only had the concept of words, without all the structures and so forth that give C more power.
a!b
was a word offset from a word address but the implementation we used also had options for byte offset from word address a!%b
, and byte offset from byte address a%%b
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With