-1

everyone! I'm trying to become familiar with TinyOS. I'd like to know the difference between uint8_t and uint16_t.

Thank you in advance :-)

rick87
  • 51
  • 9
  • They seem to be unsigned 8 bit integer and unsigned 16 bit integers. Check out this useful page from Microsoft for explanations of those types: https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx – JG7 Aug 03 '17 at 10:44

1 Answers1

1

Just for the sake of thoroughness:

Data types come in many shapes and sizes. The two you are referring to are of types unsigned 8 bit integer and unsigned 16 bit integer.

An integer is a whole number that can be positive or negative; however, in the case of types an unsigned integer can only be positive as it does not designate space for a sign (i.e. a negative sign). 8 bit and 16 bit refer to the amount of space the integer takes up in memory. An unsigned 8 bit integer's values can be 0 - 255 while an unsigned 16 bit integer can hold values from 0 - 65,535 (Side note: If you are familiar with networking you may notice that 65,535 is the largest port number possible. This is due to the fact a port number is an unsigned 16 bit integer.)

Hope this helps.

JG7
  • 371
  • 2
  • 10