Your task is to define a class named Register8 with:
Register8
uint8_t value
setValue(uint8_t v)
printRegister(const Register8& r)
The program will:
Example
Output:
Register value = 170
Why this output?
Because the friend function is allowed to peek into the private value and print it.
Question Significance
This introduces friend functions, which can access private members of a class — useful in debugging or helper utilities.
Test Cases
Test Results
Input
Expected Output