User Tools

Site Tools


c_data_types

This is an old revision of the document!


Built-in (fundamental) C++ data types:

  • integral
    • bool (true, false)
    • char, wchar_t
    • int, long, long long
  • floating point
    • float
    • double
    • long double
  • void

User-defined types:

  • enumerations
  • classes

Also consult:

  • <cstdint>
  • <numeric_limits>
  • <cstddef>

String literals:

  • statically allocated so it's safe to return them from functions

New with C++11:

  • alignas
  • alignof
  • std::alignment_of

Deducing a type:

  • auto for deducing a type of an object from its initializer; the type can be the type of a variable, a const, or a constexpr.
  • decltype(expr) for deducing the type of something that is not a simple initializer, such as the return type for a function or the type of a class member.
c_data_types.1517735264.txt.gz · Last modified: 2018/02/04 09:07 by rpjday