From the course: C Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Primitive arrays

Primitive arrays

- [Instructor] The primitive array type is commonly called a C-array because it's inherited from the C language. A primitive is a type that's defined as part of the language, as opposed to a derived type that's defined in a structure or a class. The array is a primitive type. Primitives are essential tools for building derived types. There's also an STL class called array and this can lead to some confusion. This lesson is not about the STL class. This lesson is about the primitive array data type or the C-array. An array is a fixed size container of objects where each object is the same type. This is a definition for an array of integers. The value in the square brackets defines the size of the array. This array has room for five integers. Once defined, the size of the array cannot be changed. At this point, the array is uninitialized. So each of the five integer values are undefined. It's always a good idea to…

Contents