Why does the arrow (->) operator in C exist?

(stackoverflow.com)

11 points | by signa11 8 hours ago ago

4 comments

  • Tor3 6 hours ago ago

    As was mentioned in one of the comments which actually described what the real cause was, it came from the original Ritchie C which had a syntax which in some cases differed a lot from what eventually became C. And in that version it did make sense to use a different operator. That reason disappeared when C as we know it came around, but the -> operator stayed. The real question is then why that wasn't reworked as well, when the underlying cause was.

  • furyman 7 hours ago ago

    Majorly for reference. Reference to memory. I've seen mostly being used to carry pointer based operations. It make memory management efficient and also helpful in mindful and secure uses of memory.

  • rurban 7 hours ago ago

    To denote that it is more costly than .

  • shanius 8 hours ago ago

    [dead]