I have to implement a method that writes a byte to an ostream
object. Let's just called this ostream
object strobj
. I also have a bit buffer used to store a byte of data, let's call it:
char &bitter;
In my header file, I have this:
void writeThisByte(int sumInt);
The instructions says that I have to write the "less significant byte" of the int being passed in to an ostream
object, i.e. strobj
;
However, I am confused on exactly what the least significant byte means.
Does this mean you are checking to see whether sumInt == 1
? And if it is, do you write it to the ostream
like this?
strobj.write(&bitter, 1);
I'm not sure :(