Structures: combining data elements

A data structure is defined using the struct keyword. It lets you combine data items of different types. The data items that make up a struct are called elements.

A struct is a user defined data type. A struct usually begins with an Uppercase letter.

Once the struct is defined, you can declare data items to be that type.

Please study the material at each of the links below.

  1. A student is a person
  2. Declaring with initial values
  3. A manager is an employee is a person
  4. A manager is an employee with initial values
  5. The time_t struct
  6. The current date and time
  7. Finding a Persons age
Like us on Facebook:

OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher:
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License
Last modified: May 18 2017 14:08:22.