Week 05-06: Arrays and Null-Terminated Strings.

 

Learning Outcomes:

An array is a collection of variables of the same type that are referred to through a common name. A specific element in an array is accessed by an index. In C/C++, all arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element. Arrays may have from one to several dimensions. The most common array is the null-terminated string, which is simply an array of characters terminated by a null. Arrays and pointers are closely related; a discussion of one usually refers to the other. This chapter focuses on arrays. One should read both to understand fully these important constructs.

 

 

Lesson Plan:

Lecture 01: Studying the (a) Single-Dimension Arrays, (b) Generating a Pointer to an Array.

Lecture 02: Discussion on (a) Passing Single-Dimension Arrays to Functions, (b) Null-Terminated Strings.

Lecture 03: Discussion on (a) Two-Dimensional Arrays, (b) Arrays of Strings.

Lecture 04: Learning (a) Multidimensional Arrays, (b) Indexing Pointers (c) Array Initialization.

Lecture 05: Studying (a) Unsized Array Initializations, (b) A Tic-Tac-Toe Example.

Lecture 06: Exercising the programing.