Please enable JavaScript to use CodeHS

Data Structures in C++

Lesson 2.3 Structs

Description

In this lesson, students will be introduced to the idea of a struct. A struct is a basic C++ element that is used to store multiple data elements (members) in a single variable. Students will explore how to create and access structs in this lesson.


Objective

Students will be able to:

  • Create user-defined structs
  • Access and update struct member values
  • Understand when and where structs can be used