Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  By definition, the subscript operator [] is interpreted in such a
  way that ‘‘E1[E2]’’ is identical to ‘‘*((E1) + (E2))’’.  Because
  of the conversion rules which apply to +, if E1 is an array and
  E2 an integer, then E1[E2] refers to the E2th member of E1.
  Therefore, despite its asymmetric appearance, subscripting is a
  commutative operation.¹
¹ Dennis M Ritchie, C Reference Manual, 1975 http://cm.bell-labs.com/cm/cs/who/dmr/cman.pdf (A revised version of this became Appendix A to K&R.)


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: