Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by prirun

3 days ago

One of the most "fun" things with Fortran is the EQUIVALENCE stmt. It specifies that two variables share the same memory, even if they are different types. You can also do array equivalences, so:

  INTEGER ARR1(10), ARR2(5)
  EQUIVALENCE (ARR1(6), ARR2)
  ARR2(1) = 10

will also set ARR1(6) to 10.

0 comments

prirun

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities