{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

class_notes10

# class_notes10 - Engineering 3 Class 10 Previously...

This preview shows pages 1–6. Sign up to view the full content.

Engineering 3 – Class 10 Today: • more arrays Note: Brendon’s office hours: Today from 11-12 pm, Rm. 1117 Previously: • manipulating variables •control structures • functions • introduction to arrays

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
•Refer to earlier examples and notes for guidance. •Remember academic dishonesty policy…. Homework 3
• another DATA STRUCTURE • useful for time series, spatial data • consist of related elements , of same type •referto array using array name (eg. c) • refer to array element using array name and position of element in array (eg. c[3]) • first element of array? • length of array? • last element of array? Arrays in C 53 c[0] 2 c[1] -35 c[2] 1024 c[3] 0 c[4] 1 c[5] -562 c[6] -3 c[7] 1024 c[8] c[0] 9 c[8]

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
• Defining arrays: int c[10]; double x[256]; char name[13]; Arrays in C • Initializing arrays: int a[4] = {2, 6, 9, 10}; double x[256] = {0}; •Manual initialization: • initialize an array to hold the first 10 integers (start at 1)
Arrays in C • refer to individual elements of an array using an

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 10

class_notes10 - Engineering 3 Class 10 Previously...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online