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

Lobsters Hottest News

Summary

An article explaining the historical and technical reasons for the existence of the arrow operator (->) in the C programming language.

<p><a href="https://lobste.rs/s/garq37/why_does_arrow_operator_c_exist">Comments</a></p>
Original Article

Similar Articles

Getting silly with C, part &((int*)-8)[3]

Lobsters Hottest

A humorous educational article covering C programming fundamentals such as forward declarations, operator precedence, unconditional jumps, and basic arithmetic with intentionally silly code examples.

Curly braces: An evolution of Unix and C

Hacker News Top

A detailed exploration of how curly braces were typed on early Unix systems with Teletype Model 33, covering ASCII 1963, trigraphs, digraphs, and terminal driver translations.

Discussion about C array type semantics

Lobsters Hottest

The article explains the confusing behavior of C array types, including their decay to pointers, exceptions like sizeof and function parameters, and compares it to function types, suggesting a mental model where arrays and pointers are strictly separated.

sizeof is surprisingly difficult to parse in c

Lobsters Hottest

This article explores the challenges of parsing the C `sizeof` operator, which can take either an expression or a parenthesized type, and the extra complications introduced by compound literals and postfix operators. It discusses parsing strategies and notes that C2y's newly introduced `_Countof` operator faces similar issues.

Going Backward

Lobsters Hottest

This article explores the design evolution of Go's slices.Backward function, illustrating different implementations from simple reversal to callback-based iterators, and explains why the standard library's iterator signature looks the way it does.