When will you use uint_least16_t

I look at stdint.h and given that it has uint16_t and uint_fast16_t, what do you need to use for uint_least16_t, what would you like, what could not be done equally well with one of the other two?

+5
source share
3 answers

Suppose you are working on a compiler:

  • unsigned char - 8 bits
  • unsigned short - 32 bit
  • unsigned int - 64 bit

And unsigned int is the "fastest". On this platform:

  • uint16_t will not be available
  • uint_least16_t will be a 32 bit value
  • uint_fast16_t will have a 64-bit value

A bit secret, but why is it needed.

- - . , . "" "" , , (, - ).

+10

Ah, , , : " typedef uint_leastN_t N, ".

, :

uint_least16_t , uint16

uint_fast16_t , uint16

uint16_t uint16, , , , uint_least16_t, . , , uint_least16_t.

+2

This is part of the standard c. It does not need good use .: P

Take a look at this page and find the section titled "Minimum Values ​​for Integer Types."

0
source

All Articles