In this project, you will explore how characters are represented
numerically in a computer, and compare the decimal, hexadecimal, octal,
and binary formats for those numbers.
The project will also give you additional practice with programming in C
and using git.
(See the Kit
Help Page
Working with Kit Repositories
(plain text version) for reminders on using Git and
Kit together.)
You should work on this project individually. You may talk to your neighbors in class, or to friends or the TAs in the Collaboration Center, but you should submit your own work. Don't forget to document any help you receive in your program.
characterRepresentation or charRep.)
*.h), several C source files (*.c),
several testfiles (testfile1.txt and others),
an INSTRUCTIONS.md and a README.txt file.
README.txt file to learn what the program
is supposed to do.  Compile and run it with each of the input
testfiles, and compare the results to what the README.txt file
claimed.  You will probably want to cat each input file before
running the program on that file, so that the output will make more sense.
    cat testfile1.txt
    ./a.out testfile1.txt
characterReps.c to see
    what it does.
main function.
    It is quite a bit longer and more complex than the
main function in the PowersOfTwo Project, although the changes
you will be making are quite simple.
    buffer variable.
        This is an array of characters that has to be big enough to handle
        however many characters are on a single line of the input.  Since
        we can't know in advance how big that needs to be, we use the value
        BUFSIZ, which is defined in stdio.h as
        the maximum number of characters your computer can handle on a
        single line.
    fptr variable is a
        file pointer to either the input file or standard input (the
        keyboard) — in other words, where the program will get the
        input.
    fgets
        tells it to read at most BUFSIZ characters from the
        file specified by fptr and put those characters in the
        buffer character array.  (The loop ends when
        fgets returns NULL because it hit the end
        of the file.)
        The program then gets the length of the line and prints out the first
        character in several different formats.
        ⇒ What it should be doing is printing out the value of every character in the line in several different formats, not just the first character.Then it prints the value of the final null byte at the end of the line in several formats, followed by an extra newline for readability.
characterReps.c source file to make the program print
all the characters in the line in all formats, not just the first character
in the line.
As specified in the syllabus, your program should adhere to the
Kalamazoo College CS Program Style
Guide and Documentation
Standards, including use of the Braces Line Up style
pattern.
README.txt) to better reflect the
    current functionality of the program.
    (The purpose of external documentation is to provide enough information
    for a new user to know how (and why) to use your program.)
git status,
    git add, git status,
    git commit -m 'short descriptive message', and
    git push.
printIntAsBinary.c file from your PowersOfTwo
    project to this directory.
main function to print each character in
    binary format as well (decimal, hex, octal, and binary).
    (You can look at your PowersOfTwo code for a reminder of how to do
    this.)
    Test and debug as necessary.
README.txt) to reflect the
    current state of the program.
git status/add/commit/push.
Remember, you can complete the edit/add/commit/push cycle repeatedly. In fact, pushing versions of your project while it is still under construction is a way to create backups of your work as you go.