Bits and characters
Starter code: bits-package.tar
Upload via Moodle as: bits.tar
Goals
- Practice bit operations (~, |, &, ^, <<, >>) in C
- Dig into the details of the UTF-8 character encoding
- Practice writing your own tests
Rubric
2 - to_upper correctness
2 - to_lower correctness
3 - middle_bits correctness
3 - to_utf8 correctness
2 - from_utf8 correctness
3 - code quality
Note that "correctness" in this rubric includes "meets all documented specifications". So, for example, if you don't follow the requirement "to_upper may only use bitwise operations on the chars in s" in the documentation for to_upper, that comes out of your "to_upper correctness" score.
Your assignment
- Implement the five functions documented in the bits.h file in bits-package.tar.
- Put your implementations in bits.c (a starter version of which is provided in the package).
- Do not change bits.h.
- Submit your file(s) as bits.tar via Moodle.
The only file you are required to submit is bits.c. You may include your own main.c and Makefile (starters of which are included in bits-package.tar), but we will use our own main.c and Makefile to do our testing and grading.