Question.1
A developer fills a UART transmit buffer of size 8 and then reads it back:
uint8_t tx_buf[8] = {0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6, 0x07, 0x18}; for (int i = 0; i <= 8; i++) { send_byte(tx_buf[i]); }
What is wrong with this code?
Select Answer
The loop runs 9 times — tx_buf[8] is an out-of-bounds access
tx_buf[8]
The array should be declared as int[], not uint8_t[]
int[]
uint8_t[]
send_byte() cannot accept uint8_t
send_byte()
uint8_t
Nothing — the loop correctly sends all 8 bytes