



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
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..)