class_notes10

class_notes10 - Engineering 3 Class 10 Previously:...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
•Refer to earlier examples and notes for guidance. •Remember academic dishonesty policy…. Homework 3
Background image of page 2
• 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]
Background image of page 3

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

View Full DocumentRight Arrow Icon
• 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)
Background image of page 4
Arrays in C • refer to individual elements of an array using an
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/06/2010 for the course ENGR 3 taught by Professor Ben-yaakov during the Summer '08 term at UCSB.

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 Right Arrow Icon
Ask a homework question - tutors are online