You are given a ConfigRegister struct that simulates a 16-bit configuration register.Each bit in the register has a specific meaning:
Your task is to validate the register:
Use pointer logic (-> or (*ptr).field) to access the data.
Example-1
Input: reg = 0x0005 (binary: 0000000000000101) Output: 1
(Enable = 1, Mode = 0, Priority = 01 → Valid)
Example-2
Input: reg = 0x000B (binary: 0000000000001011) Output: 1
Example-3
Input: reg = 0x0015 (binary: 0000000000010101) Output: 0
(Bit 4 is set → Reserved violation)
Test Cases
Test Results
Input
0005
Expected Output
1