CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

Dealing with text

Part 7. Arrays & Structures

Skill 19 

Arrays

example building a team

Some rules when using arrays

Arrays with <iostream.h>

  • Arrays work exactly the same with franca.h or iostream.h.
  • In the text examples, page 224, you can build equivalent functions: getarray and showarray using only <iostream.h>

Array applications:

  • Inputting and Outputting arrays
  • Using multiple arrays with same index
  • Modifying contents of array in functions (arrays are references)
  • Searching an array:
  • Searching for a given value
  • Searching for the location (index) of a given value
  • Searching for largest (or smallest) element

 

 

Skill 20

          Using strings with <iostream> (this part is not in the book!)

An alternative to using the string objects is to use character arrays, also supported by C++.

This is covered on the book, starting on page 233. This material WILL NOT be required for class. We will use string objects instead.

Dealing with text using character arrays (not covered)

 

Structures (not covered)

Examples