C++ Tokens

In C++, tokens are the minimal chunk of program that have meaning to the compiler.

Token typeDescription/PurposeExamples
KeywordsWords with special meaning to the compilerint, double, for, auto
IdentifiersNames of things that are not built into the languagecout, std, x, myFunction
LiteralsBasic constant values whose value is specified directly in the source code"Hello, world!", 24.3, 0, 'c'
OperatorsMathematical or logical operations+, -, &&, %, <<
Punctuation/SeparatorsPunctuation defining the structure of a program{ }, ( ), ,, ;
WhitespaceSpaces of various sorts; ignored by the compilerSpaces, tabs, newlines, comments