Create a class ByteBuffer that stores an array of exactly 8 bytes using uint8_t and allows indexed access using an overloaded operator[].
ByteBuffer
uint8_t
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
v
Numeric Rules (Explicit):
Example Input:
1 2 3 4 5 6 7 8 3 99
Example Output:
1 2 3 99 5 6 7 8
Constraints:
0–7
0–255
Test Cases
Test Results
Input
Expected Output