Home
Syllabus
Homework
Example Code
Notes
Links
Introductory Examples for C
Sorting examples:
sorting.c
Macro examples:
macro.c
Computing Fibonacci numbers using recursion and iteration:
fib.c
Using a structure to create a deck of cards:
structex.c
Finding palindromes:
palindrome.c
Printing random numbers:
rand_nums.c
Printing random numbers using a seed:
rand_nums_seed.c
Tic Tac Toe:
TicTacToe.h
,
TicTacToe.c
,
tttmain.c
,
makefile.ttt
Examples from the book
Practical C Programming
by Steve Oualline (available in the library):
examples.tar
Shared memory examples based upon examples from Chapter 3 of the text:
shmem_producer.c
,
shmem_consumer.c
MPI (Message Passing Interface) Send/Receive example:
message_passing.c
Thread addition:
thread_add.c
MPI Non-blocking send and receive example:
messages_nb.c
Multiple message MPI_Wait Non-blocking send and receive example:
many_messages.c
Multiple message MPI_Waitall Non-blocking send and receive example:
many_messages2.c
Race Condition Example:
rc_broken.c
Semaphores Example:
rc_fixed.c
Producer Consumer Example Using Threads:
prodcons.zip
MPI Producer Consumer Example:
MPIprodcons.zip
Dining Philosophers Example:
philosophers.c
Condition Variable and Scheduling Example:
ConditionVariable.c
MPI Dining Philosophers Example:
mpiPhilosophers.c
MPI-IO Example:
MPI_IO.zip
Program 4 Linked List Example:
linked_list_prog4.zip