LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

What additional data types does C++ add compared to C?

C++ adds bool (true/false) and wchar_t (a wide character) as built-in types.

Type Size Purpose
bool 1 byte Boolean — holds true or false
wchar_t platform-dependent Wide character for larger character sets

In C these aren't built in:

  • bool requires #include <stdbool.h> (added in C99)
  • wchar_t lives in #include <wchar.h>

Gotcha: wchar_t's size is not fixed by the standard. It's commonly described as a 16-bit type (and is 2 bytes on Windows), but with g++ on Linux it is actually 4 bytes. If you need a guaranteed width, use char16_t/char32_t.

C++ also adds (beyond plain data types):

  • References (int&)
  • Classes and objects
  • STL containers (vector, string, etc.)

From Quiz: REVE1 / C++ Programming | Updated: Jul 14, 2026