Lecture Summaries - Week 10
Jump To:
[Lecture Index |
Previous Week's Lectures |
Next Week's Lectures]
Topics covered:
- What happens when we use a bad array subscript.
- How preventing accessing beyond the end of an array
often involves leaving a loop early.
- How to use a logical AND to leave the loop early.
- An example of an improved input-reading function
(readem2.c).
- How to use the break statement to leave loops early.
- An example of an input-reading function using break
(readem3.c).
- How the for loop can do more than count up or down.
- An example of our input-reading function redone using for
(readem4.c).
- A very concise version of our input-reading function
using for
(readem5.c).
- What sorting is and what it has to do with arrays.
- What insertion sort is and how it works.
- How we implement insertion sort.
- A main program assuming table_insert exists to put
elements in their correct place
(insert.c).
- The table_insert function
elements in their correct place
(tabinsert.c).
Reading: Chapter 7.3
Topics covered:
- How lifetime, visibility, and initialization are three important
properties of variables.
- How we describe local variables in terms of these properties.
- How we describe function parameters in terms of these properties.
- What variables local to a ``block'' are.
- How we can initialize all local variables when we declare them.
- How initializing variables when we declare them prevents the
common mistake of failing to initialize them.
- How we can declare more than one variable at a time.
- What global variables are and how we declare them.
- Describing global variables in terms of their lifetime, visbility,
and initial values.
Reading: Chapter 8.1 and 8.2
Topics covered:
- Using global variables.
- An example program to count and print the different scores
in its input
(counter1.c).
- The trade-offs in using global variables versus passing
values as parameters.
- That same example program rewritten without global variables.
(counter2.c).
- Using global function prototypes.
- Why and how to create and use our own header files.
Reading: Chapter 8.5
[EE150 Home Page |
Top Of Page]