operator(7)

๐Ÿ‘‘ NAME ๐Ÿ‘‘

okay so bestie, welcome to operator(7) โ€” this one lives in the Miscellaneous Information Manual (section 7, the vibes section ๐Ÿ’…), and it's literally just:

operator โ€” C operator precedence and order of evaluation ๐ŸŒธ

That's it. That's the whole assignment. It's a cheat sheet, and it slays.


๐Ÿ“‹ DESCRIPTION ๐Ÿ“‹

so this page just lays out all the C operators and tells you who goes first when the compiler has to figure out what you meant. precedence + associativity = the group chat hierarchy of operators, no cap. ๐Ÿ”ฅ

Here's the ranking, from "I get a say before everyone" down to "I go last, unfortunately":

  • () _Generic() โ€” Associativity: - โ€” Notes: [1]
  • [] () . -> ++ -- (type){} โ€” Associativity: left to right โ€” Notes: [2] [3]
  • ++ -- & * + - ~ ! _Countof sizeof alignof _Maxof _Minof โ€” Associativity: right to left โ€” Notes: [4]
  • (type) โ€” Associativity: right to left
  • * / % โ€” Associativity: left to right
  • + - โ€” Associativity: left to right
  • << >> โ€” Associativity: left to right
  • < > <= >= โ€” Associativity: left to right
  • == != โ€” Associativity: left to right
  • & โ€” Associativity: left to right
  • ^ โ€” Associativity: left to right
  • | โ€” Associativity: left to right
  • && โ€” Associativity: left to right
  • || โ€” Associativity: left to right
  • ?: โ€” Associativity: right to left
  • = *= /= %= += -= <<= >>= &= ^= |= โ€” Associativity: right to left
  • , โ€” Associativity: left to right
๐ŸŒˆ Top of the list = highest precedence. Bottom = lowest. Read it like a leaderboard, because that's exactly what it is. โœจ

๐ŸŽ€ the notes, bestie ๐ŸŽ€

the following notes provide further information to the above table ๐Ÿซถ:

  • [1] The () at this precedence is the parenthesized expression.
  • [2] The () at this precedence is the function call operator.
  • [3] The ++ and -- operators at this precedence level are the postfix flavors of the operators.
  • [4] The ++ and -- operators at this precedence level are the prefix flavors of the operators.
๐Ÿ’€ not the same two symbols showing up in different rows doing completely different jobs. () is out here with main character energy in two separate spots, and ++ -- did it too. iykyk.

and that's the whole page!! go forth and parenthesize when you're unsure, because precedence is a liar sometimes ๐Ÿ˜ญ ๐Ÿฆ‹

this delightful little dispatch came to you from Linux man-pages 6.20, dated 2025-12-01 โ€” mwah, periodt ๐Ÿ’–๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: BSD-3-Clause
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms