Please send questions to
st10@humboldt.edu .
/*--------------------------------------------------
created by smtuttle at Wed Apr 21 14:49:26 PDT 2010
--------------------------------------------------*/
#include <iostream>
#include <cmath>
using namespace std;
/*--------------------------------------------------
Contract: show_strings : string[] int string -> void
Purpose: expects an array of strings, its size, and a
desired title, and it returns nothing,
but it has the side-effect of printing
that title to the screen, then a blank line,
then each string in the array on its own line
Examples:
for this array:
const int NUM_NAMES = 4;
string family_names[NUM_NAMES] = {"Tuttle", "Hughes", "Rose", "Lowell"};
then:
show_strings(family_names, NUM_NAMES);
show_strings(family_names, NUM_NAMES, "My Family Names");
should print to the screen:
My Family Names
Tuttle
Hughes
Rose
Lowell
--------------------------------------------------*/
void show_strings(string strings[], int num_strings, string title)
{
cout << title << endl;
cout << endl;
for (int index=0; index < num_strings; index++)
{
cout << strings[index] << endl;
}
}