storing values in a byte

Hi all,
I am currently working on a line follower robot which uses a 8 sensor array. The sensors return the value of either 1 or 0. I want to store the outputs of each IR sensor pair as 8 bits of a byte rather than using an array of size 8.
Is there any function in the arduino which can accomplish this task?

Hello,

See function bitWrite.

You can also use the left shift operator << to move the bits within a byte and make space for another at the RHS. There is also a right shift operator >>

…R