Why does the arrow (->) operator in C exist?
signa11
13 points
4 comments
May 22, 2026
Related Discussions
Found 5 related stories in 81.8ms across 8,303 title embeddings via pgvector HNSW
- Why does C have the best file API maurycyz · 95 pts · March 01, 2026 · 47% similar
- Everything in C is undefined behavior lycopodiopsida · 481 pts · May 20, 2026 · 40% similar
- Writing a C Compiler, in Zig (2025) tosh · 150 pts · April 23, 2026 · 39% similar
- Why is this program erroneously rejected by three C++ compilers? tornikeo · 24 pts · March 14, 2026 · 39% similar
- All elementary functions from a single binary operator pizza · 194 pts · April 13, 2026 · 37% similar
Discussion Highlights (4 comments)
furyman
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
To denote that it is more costly than .
Tor3
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.
glouwbug
Probably because (*p).field already worked