Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

Punctuation

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

Language
  • C++11
  • C++14
  • C++17
  • C++20
  • C++23
  • C++26
8 min readView on cppreference
NotebookLM

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

Preprocessing operators

Preprocessing operators are recognized by preprocessors.

# (including %:)

##(including %:%:)

Single-character operators and punctuators

{ and } (including <% and %>)

(since C++11)
(since C++20)

[ and ] (including <: and :>)

(since C++11)
(since C++17)
(since C++26)

( and )

(since C++11)
(since C++11)
(since C++17)
(since C++20)
(since C++11)
  • In a handler, delimit the parameter declaration.
  • In a function-like macro definition, delimit the macro parameters.
  • In a function-like macro invocation, delimit the macro arguments or prevent commas from being interpreted as argument separators.
  • Part of a defined, __has_include(since C++17), __has_cpp_attribute(since C++20) preprocessing operator.
  • In a static_assert declaration, delimit the operands.
  • Delimit the operand of the following specifiers:
(since C++20)
  • In an attribute, delimit the attribute arguments.
(since C++11)
(since C++14)
(since C++17)
  • Part of __VA_OPT__ replacement in a variadic macro definition.
(since C++20)

;

  • Indicate the end of
(since C++20)

:

(since C++11)
(since C++17)
(since C++20)

?

.

(since C++20)

~ (including compl)

! (including not)

(since C++23)

+

-

*

  • Part of *this in a lambda capture list, to capture the current object by copy.
(since C++17)

/

%

^ (including xor)

& (including bitand)

(since C++11)

| (including bitor)

=

(since C++11)
(since C++20)

<

(since C++20)
(since C++17)
(since C++20)

>

(since C++20)
(since C++17)
(since C++20)

,

(since C++11)
(since C++17)
(since C++23)
(since C++11)

Multi-character operators and punctuators

...

  • 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 handler, signify catch-all handler.
(since C++11)
(since C++26)

::

  • Scope resolution operator in
(since C++11)
(since C++17)

.*

->

(since C++11)
(since C++17)
(since C++20)

->*

+=

-=

*=

/=

%=

^= (including xor_eq)

&= (including and_eq)

|= (including or_eq)

==

!= (including not_eq)

<=

>=

<=>

(since C++20)

&& (including and)

(since C++11)

|| (including or)

<<

>>

<<=

>>=

++

--

References

  • C++23 standard (ISO/IEC 14882:2024):
  • 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

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.