Lecture Demos:


Lecture 2: The Hello World demo and the Precision demo.

Lecture 3: The slightly expanded Precision demo, with a math library call.

Lecture 5: The Range demo and the Sizeof demo.

Lecture 8: Multiple files -- N-Queens in three acts.

Lecture 12: Pointer arithmetic and resultant abominations in badpointer.c.

Lecture 14: Pseudo-dynamic allocation and word-alignment in alloc.c.

Lecture 17: Witness the beauty of struct sizes in struct-size.c.


Advanced topic: Sockets

Lecture 25: A snippet of code for a server to set up a socket on a known port, and then return a connected socket when a client contacts the server. serverSocket.c.

Lecture 26: A snippet of code for a client to set up a socket and connect to a server on a known port. clientSocket.c.


Advanced topic: Processes

Lecture 24: Processes. printArg.c.

Lecture 25: Fork and Pipe.

  • Fork a child process to execute a command: myFirstFork.c.
  • Parent and child get distinct copies of original process memory: mySecondFork.c.
  • Do not share file descriptors: sharedIn.c, sharedOut.c.
  • A pipe from parent to child: parentToChild.c.
  • Piping stdout from the parent to stdin on a child process running a paging command: moreQueens.c.

  • Back