I can't seem to wrap my head in the code below.
Does this create a data type the size of 8 bytes? But don't I need 512 bytes for the buffer?
Does this create an array with 8 bytes for each element in the array?
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.Sign up to join this community
No, a uint8_t is not 8 bytes, it's 8 BITS. 8 bits = 1 byte.
A uint8_t is an unsigned 1 byte data type, or a BYTE, once you define a BYTE in your code as a data type. A char behaves like a SIGNED 1-byte data type, thus the need for the uint8_t. It's the easiest way to handle data that you just want to process in a raw form.
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)