Value Types

This lesson introduces the concept of value types and discusses the & operator in more detail.

Value types are easy to describe: variables of value types carry values. For example, all of the integer and floating point types are values types. Although not immediately obvious, fixed-length arrays are value types as well.
For example, a variable of type int has an integer value:

  int speed = 123;

The number of bytes that the variable speed occupies is the size of an int. If we visualize the memory as a ribbon going from left to right, we can imagine the variable living on some part of it:

Get hands-on with 1200+ tech skills courses.