#include <stdio.h>

/*
 * Program to show a function that can print any size integer
 * array. Note that when the function call is made, only the name of
 * the array is passed in as an argument (no square brackets).
 *  Terry Harvey CISC 105 section 98 TA Janet
 */

void printArray(int data[], int size);

int main(){

    int temperatures[100];
    int heights[10];
    int i;
    
    /* initialize first array */
    for(i = 0; i < 100; i++)
	temperatures[i] = i * 5;

    /* initialize second array */
    for(i = 0; i < 10; i++)
	heights[i] = i * 5;

    printf("\n\ntemperatures are: ");

    printArray(temperatures, 100);

    printf("\n\nheights are: ");

    printArray(heights, 10);

    return 0;
}

/* This function prints an integer array of any size, but the size
   must be passed in as a parameter. Note that the square brackets are
   needed inside the parameter list, since the compiler needs to know
   that the varaible data is an array being passed in, not just an
   integer */
void printArray(int data[], int size){
    int i;
    for(i = 0; i < size; i++)
	printf("%d ", data[i]);
    printf("\n");

    return;
}
