Why does the arrow (->) operator in C exist?
signa11
13 points
4 comments
May 22, 2026
Related Discussions
Found 5 related stories in 1215.7ms across 14,015 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
- C programmers commit fresh crimes against readability jjgreen · 13 pts · July 05, 2026 · 40% similar
- C programmers commit fresh crimes against readability Bender · 126 pts · July 06, 2026 · 40% similar
- Writing a C Compiler, in Zig (2025) tosh · 150 pts · April 23, 2026 · 39% 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