The goal of this project is to convert character streams into sequences of bits and to convert sequences of bits into character streams, using binary representations of ASCII codes.
The character streams are enclosed between double quotes, the bit sequences are enclosed between < and >. As with many programs we have seen in class, this program runs using redirection on a unix system. So, do not include any dialogue with the user.
For example, if the file charmcs260 contains "MCS 260", then we can create the file bitsmcs260 with our executable bitschar by typing
bitschar < charmcs260 > bitsmcs260
Then the content of the file bitsmcs260 is
<01001101010000110101001100100000001100100011011000110000>
The first 8 bits in bitsmcs260 are 01001101 which is
the binary representation of 77, which is the ASCII code of the M
of "MCS 260". Every byte (1 byte = sequence of 8 bits)
in the sequence equals
the ASCII code of the corresponding character in the input.
To convert sequences of bits back into character streams, we type
bitschar < bitsmcs260
As a result of this, you should see "MCS 260" displayed on screen.
The first line of your program should be like
/* MCS 260 Project Four by <Author> */
where you replace the <Author> by your name.
The gcc compiler will be used to test your program. So even if you have developed your program in a Windows environment, test your code on icarus.cc.uic.edu with gcc. To ensure your program is written in ANSI C, compile with the option -ansi, e.g., like
gcc -ansi proj4.c
Programs that are not conform the ANSI C standard will
be discounted.
The printout of your program will be collected at the start of the lecture on Friday 2 November, at 1PM. Before the deadline, send the code by e-mail to janv@uic.edu from your account on icarus. If you saved your program in the file proj4.c, then you send your program typing on icarus the following command :
mail janv@uic.edu < proj4.c
This ensures your program is free from any encapsulations.
Note that the e-mail address is my university netid and not
the address at the MSCS department.
If you have questions, comments, or difficulties, feel free to come to my office for help.