Computer Science 381
Programming Unix in C
Winter Immersion 2016, The College of Saint Rose
In this lab you will start to learn about pointers and the closely related topics (at least for C programmers) of arrays and strings. Even if you never write a C program after this course, understanding how C programs manage pointers will improve your programming in nearly any language.
Recall that you will also be finishing up the programming assignment from last week's lab, so there is not much additional programming here.
Read About It
Read the first 4 sections of Chapter 5 in K&R. It's only 11 pages, but it's a pretty intense 11 pages.
A Pointer/Array Example
See Example:
/home/cs381/examples/isort
The above example includes two C functions that each perform an insertion sort on an array of int. You can switch between the two implementations of the sorting function to verify that both do work.
Submission
Please submit all required files as email attachments to terescoj AT strose.edu by Tuesday, December 29, 2015. Be sure to check that you have used the correct file names and that your submission matches all of the submission guidelines listed on the course home page. In order to email your files, you will need to transfer them from mogul to the computer from which you wish to send the email. There are a number of options, including the sftp command from the Mac command line.
Grading
This lab is graded out of 50 points, including the programming assignment described in the previous assignment.
Grading Breakdown | |
Lab questions | 9 points |
Practice program swapper.c correctness | 7 points |
Practice program isort.c pointer-based printing | 4 points |
extremes.c correctness | 20 points |
extremes.c design | 3 point |
extremes.c documentation | 3 points |
extremes.c style | 3 point |
extremes.c efficiency | 1 point |
Total | 50 |