Question.5
A developer writes a utility to clear a buffer:
void clear_buffer(uint8_t buf[64]) { for (int i = 0; i < sizeof(buf); i++) buf[i] = 0; }
He expects this to zero all 64 bytes. Will it?
Select Answer
Yes — the parameter declares buf as a 64-element array
No — buf decays to a pointer inside the function
Yes — but only on platforms where sizeof(uint8_t*) == 64
sizeof(uint8_t*) == 64
No — sizeof cannot be used on function parameters at all
sizeof