Create a class ByteBuffer that stores an array of exactly 8 bytes using uint8_t and allows indexed access using an overloaded operator[].
The class must support:
Writing to a specific byte
buffer[i] = value;
Reading a specific byte
x = buffer[i];
The overloaded operator must return a reference so that assignments work correctly.
Program Behavior:
idx and a value vNumeric Rules (Explicit):
uint8_tExample Input:
1 2 3 4 5 6 7 8
3 99
Example Output:
1 2 3 99 5 6 7 8
Constraints:
uint8_t internally to store exactly 8 bytesoperator[] must return a reference0–7)0–255)
Input
1 2 3 4 5 6 7 8 3 99
Expected Output
1 2 3 99 5 6 7 8