Roughly speaking in C++ there are:
+
, -
, *
, []
, new
, ...
)10
, 2.5
, "100"
, ...)int
, class
, typename
, mutable
, ...){
, }
, <
, >
)#
, ##
...).But what is the semicolon?
In a C program, the semicolon is a statement terminator.
The semicolon appears at the end of every line of code in C, except for after certain braces (e.g. if statements, function definitions). So a semicolon is still needed after a forward declaration.
The semicolon is a punctuator, see 2.13 §1
The lexical representation of C++ programs includes a number of preprocessing tokens which are used in the syntax of the preprocessor or are converted into tokens for operators and punctuators
It is part of the syntax and therein element of several statements. In EBNF:
<do-statement> ::= 'do' <statement> 'while' '(' <expression> ')' ';' <goto-statement> ::= 'goto' <label> ';' <for-statement> ::= 'for' '(' <for-initialization> ';' <for-control> ';' <for-iteration> ')' <statement> <expression-statement> ::= <expression> ';' <return-statement> ::= 'return' <expression> ';'
This list is not complete. Please see my comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With