Wednesday, 20 November 2013

A Class for Bits

For this week, Fardad had us code a class that would handle a string that represented a bit pattern and overload the casting operator to have it represent them as integers and floats (at least that's what I thought he wanted). There is two approaches that I am aware of. First, after copying the bit pattern, we can calculate them manually using our code, or we can be lazy and transfer the bit pattern into a variable's bit pattern literally and have it casted to whatever we want it to represent. I went with the latter.


Post a Comment