cstdint correct use



  • I can't figure out the right use. cstdint♪ Like writing a type. uint32_t And I'm looking at his size in the programming of logic, then I'm on a platform where int > 32 and mine. uint32_t processing slowly. Okay, just use it. intwhich is always equal to the right value. If I move to another platform where int < 32the logic of my program will be hurt.

    Maybe then we need to program the logic on the smallest. int and fix values uint_leastN_t/unit_fastN_t? Or sacrifice productivity?

    And uint_leastN_t/unit_fastN_t - What are they different?



  • Types without reference fast or least Use exact size in battle. However, some architects of these types may not be present at all. As stated in Standard 18.4.1:

    namespace std {
        typedef signed integer type int8_t; // optional
        ...
    }
    

    Therefore, the code has to be used, or fastor least A version. To achieve maximum speed or minimum memory flow, respectively. Such types are already mandatory in the Standard (no word available) optional)


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2