CSCI 1120 (Low-Level Computing):
Sample Programs
Disclaimer: Code linked from this page is intended as a
cleaned-up and commented version of examples from class.
Many programs could be further improved with
regard to functionality or design, but then they would
no longer be as close to what we did in class.
Programs
- "Hello, world" program (9/02):
hello.c.
- Program showing very very simple input/output (9/09):
simple-io.c.
- Program showing very very simple conditional execution
and function (9/16):
simple-fcn.c.
- Example of loop (9/23):
loop-sum.c.
- Example of array access (9/23):
array-test.c.
- Example of working with pointers (9/30):
simple-ptrs.c.
- Example of working with strings (9/30, with additions):
simple-strings.c.
- Example of working with command-line arguments (10/14):
echo-args.c.
- I/O examples (10/14, with additions):
- Starter for program to test sort function (not in class):
sort-starter.c.
- Program to test sort function, revised to get number of elements from
command-line argument and use qsort for sorting (11/04):
sort-improved.c.
- Program illustrating how sizes of data types can vary (11/04):
sizes.c,
with
output on a 64-bit system
and
output on a 32-bit system.
- "Floating point is strange" examples (12/02):
- Makefile example:
Source code files and Makefile:
directory.
- Sorted linked list and test program:
Source code files and Makefile:
directory.
Other files