Sort Three Pointers

This is a pair exercise and must be competed in your tutorial or lab with your partner.

For this activity you will need to complete the swap() and sortThree() functions.

The swap() function should swap the values in two variables using the pointers passed in.

The sortThree() function should sort the values in three variables using pointers passed in.

Download sortThreePointers.c, or copy it into your current directory on a CSE system by running

$ cp /web/cs1511/17s2/week05/files/sortThreePointers.c .

To run some simple automated tests:

$ 1511 autotest sortThreePointers

To run Styl-o-matic:

$ 1511 stylomatic sortThreePointers.c
Looks good!

You’ll get advice if you need to make changes to your code.

Submit your work with the give command, like so:

$ give cs1511 wk05_sortThreePointers

Or, if you are working from home, upload the relevant file(s) to the wk05_sortThreePointers activity on Give Online.