Access Millions of academic & study documents

APS 105 Data Structures Presentation

Content type
User Generated
Subject
Powerpoint
Type
Presentation
Showing Page:
1/20

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/20

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/20

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 20 pages?
Access Now
Unformatted Attachment Preview
2020‐03‐19 APS105 – Lecture 29 DATA STRUCTURES 3/19/2020 APS105 – SPRING 2020 1 Today: Data Structures Structures Typedefs Allocating memory (note on Unions) Notes with excerpts from King – C Programming Kelley/Pohl – A Book on C Johnsonbaught – C for Scientists and Engineers Hanly – Problem Solving and Program Design in C 1 2020‐03‐19 Structures Arrays allow a collection of elements So far, the arrays were all of a “standard” data type: int, char, float, etc. We will see today another type of variable: struct A database is a collection of information stored in memory it is subdivided into records, which can be held within a defined data type One can store elements of different types under one label this is done using a struct General form… struct { ; } ; (note the semicolons at the end…) Structures We can declare a struct as: struct { int itemNumber, quantity; these are called char size; members, fields, double price; components } x, y; x and y are both structure variables they each contain all members/components 2 2020‐03‐19 Structures Or, you may use a tag to declare your type struct in case you need to declare many separate structs struct Student{ int student_number; char stdname[NAME_LENGTH+1]; int ranking; }student1, student2;  Now, student1 and student2 are two structs of the Student kind each has three e ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4