Weekly Programming Exercise #6
Not graded.
Solution will be discussed on Monday, 11/09.
1) Review of pointers and arrays (Do you still remember?)
Write two functions that print all the values in an array.
void printArray1(int *pArray, int sizeofarray)
{
// use *pArray (pointer) notation
}
void printArray2(int array[], int sizeofarray)
{
// use array[x] (array with subscript) notation
}
2) Think of an interesting real-life analogy of algorithms.
The examples I gave in class are a cooking recipe and ikea furniture assembly.
Can you find other interesting examples?