C++ language

This is a brief reference of available C++ language constructs. Basic concepts. Comments ASCII chart Names and identifiers Types - Fundamental types Object - Scope - Lifetime Definitions and ODR Name lookup qualified - unqualified Memory model and data races Phases of translation The main() function. C++ Keywords. Preprocessor. #if - #ifdef - #ifndef #define - # - ## - #include #error - #pragma - #line. Expressions. Value categories Evaluation order and sequencing Constant expre

C numeric limits interface

See also std::numeric_limits interface. Defined in header <cstdint> PTRDIFF_MIN (C++11) minimum value of object of std::ptrdiff_t type (macro constant) PTRDIFF_MAX (C++11) maximum value of object of std::ptrdiff_t type (macro constant) SIZE_MAX (C++11) maximum value of object of std::size_t type (macro constant) SIG_ATOMIC_MIN (C++11) minimum value of object of std::sig_atomic_t type (macro constant) SIG_ATOMIC_MAX (C++11) maximum value of object of std::si

C memory management library

Functions Defined in header <cstdlib> malloc allocates memory (function) calloc allocates and zeroes memory (function) realloc expands previously allocated memory block (function) free deallocates previously allocated memory (function) See also C documentation for C memory management library

C Date and time utilities

Functions Defined in header <ctime> Time manipulation difftime computes the difference between times (function) time returns the current time of the system as time since epoch (function) clock returns raw processor clock time since the program is started (function) Format conversions asctime converts a tm object to a textual representation (function) ctime converts a time_t object to a textual representation (function) strftime converts a tm

break statement

Causes the enclosing for, range-for, while or do-while loop or switch statement to terminate. Used when it is otherwise awkward to terminate the loop using the condition expression and conditional statements. Syntax attr(optional) break ; Explanation After this statement the control is transferred to the statement immediately following the enclosing loop or switch. As with any block exit, all automatic storage objects declared in enclosing compound statement or in the condition o

break

Usage break statement: as the declaration of the statement

Boolean literals

Syntax true (1) false (2) Explanation The Boolean literals are the keywords true and false. They are prvalues of type bool. Notes See Integral conversions for implicit conversions from bool to other types and boolean conversions for the implicit conversions from other types to bool. Example #include <iostream> int main() { std::cout << std::boolalpha << true << '\n' << false << '\n' <<

bool

Usage bool type: as the declaration of the type

bitset

This header is part of the general utility library. Includes <string> <iosfwd> Classes bitset implements constant length bit array (class) std::hash<std::bitset> (C++11) hash support for std::bitset (class template specialization) Functions operator&operator|operator^ performs binary logic operations on bitsets (function template) operator<<operator>> performs stream input and output of bitsets (function template) Syno

bitor

Usage alternative operators: as an alternative for |