Simulate a simplified UART driver that supports multiple kinds of data transmission.
You must create exactly three overloaded functions named write, each handling a different type of UART transmission:
Program Behavior
In main():
Example (Mode 1)
Input:
1 65Output:
65
Example (Mode 2)
Input:
2 HelloOutput:
Hello
Example (Mode 3)
Input:
3 4 10 20 30 40Output:
10 20 30 40
Input / Output Rules
Input: 1 <byte>
Output: <byte>Input: 2 <string>
Output: <string>Input: 3 <length> <byte1> <byte2> ...
Output: <byte1> <byte2> ...
Output formatting requirements:
Constraints:
cin >> s)
Input
1 0
Expected Output
0