



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An introduction to structures in object-oriented programming using c++. Structures are used to organize data into sets or collections, allowing the recording of related information as a single entity. Structure design, definition, setting values, structure assignment, and structures as an array. It also discusses the difference between structures and classes.
Typology: Slides
1 / 6
This page cannot be seen from the preview
Don't miss anything!
E.g. I am recognized by: First Name Last Name NIC / driving license Number My height etc. All this information represents an entity, i.e., me, and it needs to be recorded as a set
First Name Last Name NIC Number Height
Structure design
String or char[] for first name String or char[] for last name int can be used for NIC ?? Or you can make a sub-structure with three fields to identify each section of your NIC int for height
First Name Last Name NIC Number Height
Usman Younis
Structure
struct NIC { int field1; int field2; int field3; };
struct Record { char first_name[10]; char last_name[10]; NIC Identification_number; int height; };
First Name
NIC Number
NIC
Char[]
Last Name
Height
Char[] NIC int
Char[] Char[] int
Person 1 Person 2
Structure Assignment
usman younis 123, 123, 1 123
usman younis 123, 123, 1 123
Structure Assignment (contd..)
Structures as an Array
int
int
int
int
int
Structures as an Array (contd..)