Thinking in C and *nix (CSC 282 2015S) : EBoards

CSC282 2015S, Class 11: Miscellaneous C Programming Issues


Overview

Preliminaries

Admin

Questions

Sorting, revisited

In Scheme

    ;;; Procedure:
    ;;;   sort
    ;;; Parameters:
    ;;;   lst, a list (or perhaps vec, a vector)
    ;;;   order, a two-parameter predicate that represents
    ;;;     a total order.  ("Does a come before b?")

In Java, we also think about providing a Comparator (or using Comparables)

What about C? What's your signature for a procedure that sorts an array of strings?

Function pointers

Memory issues in C programs

Checking memory problems with valgrind

Testing C programs

Testing with macros

Testing through the command line

Testing with assert