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
When you look at a decimal number, say 507, the least significant digit would be the 7. Changing it to a 6 or an 8 would change the overall number a lot less than changing the 5.
When you look at a date, say May 14, 2013, the least significant part is the day (14) in terms of chronological ordering.
When you look at an unsigned 32-bit int (4 bytes), where the value of the integer is (256^3)*b3 + (256^2)*b2 + 256*b1 + b0 for the 4 bytes b0, b1, b2, b3, the least significant byte is the byte b0.
You can get the least-significant byte from your int sumInt by doing char c = sumInt & 0xFF; as others have suggested.