CS140 Lab 4 - Exploring data representation
Objective
- Experiment with data representations in C.
- Review C programming.
|
Background
|
This material is from Chapter 2 in CS:APP textbook.
|
Required Tasks
Experiment with Data Representations
- Log into your Linux account on one of the CS machines.
- Download show_bytes.c.
From the Linux command line, this will get the file and copy it to your local directory:
wget http://www.cs.clarku.edu/~jmagee/cs140/labs/lab04/show_bytes.c
- Examine this program and try to figure out what it does.
- Compile with gcc: gcc show_bytes.c -o show_bytes
- Run this program with several (at least 10) different inputs. Try 0, 1, 2, etc.
- Try to explain the resulting output.
|
Check out
When you are done with the lab exercises, submit your worksheet on Gradescope by the end of the day.