W3cubDocs

/C++

Punctuation

These are the punctuation symbols in C++. The meaning of each symbol is detailed in the linked pages.

{ }

[ ]

#

##

( )

;

:

...

  • In the parameter list of a function declaratoror lambda expression (since C++11)or user-defined deduction guide (since C++17), signify a variadic function.
  • In a catch-clause, signify catch-all handler.
  • In a macro definition, signify a variadic macro. (since C++11)
  • Indicate pack declaration and expansion. (since C++11)

?

::

.

.*

->

->*

~

!

+

-

*

/

%

^

&

|

=

+=

-=

*=

/=

%=

^=

&=

|=

==

!=

<

>

<=

>=

<=> (since C++20)

&&

||

<<

>>

<<=

>>=

++

--

,

References

  • C++23 standard (ISO/IEC 14882:2023):
    • 5.12 Operators and punctuators [lex.operators]
  • C++20 standard (ISO/IEC 14882:2020):
    • 5.12 Operators and punctuators [lex.operators]
  • C++17 standard (ISO/IEC 14882:2017):
    • 5.12 Operators and punctuators [lex.operators]
  • C++14 standard (ISO/IEC 14882:2014):
    • 2.13 Operators and punctuators [lex.operators]
  • C++11 standard (ISO/IEC 14882:2011):
    • 2.13 Operators and punctuators [lex.operators]
  • C++03 standard (ISO/IEC 14882:2003):
    • 2.12 Operators and punctuators [lex.operators]
  • C++98 standard (ISO/IEC 14882:1998):
    • 2.12 Operators and punctuators [lex.operators]

See also

Alternative representations alternative spellings for certain operators
C documentation for Punctuation

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/language/punctuators