User-Defined Literals: Raw and Cooked

In this lesson, we will study raw and cooked forms of user-defined literals.

The Four User-Defined Literals

C++11 has user-defined literals for characters, C strings, integers, and floating point numbers. For integers and floating point numbers, they are available in raw and cooked form. Due to C++14, we have built-in literals for binary numbers, C++ strings, complex numbers, and time units.

To clarify, below are the raw and cooked variations of the literal types.

Get hands-on with 1200+ tech skills courses.