This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What is the advantage of uint8_t over char or bool?

I have to migrate some C++ functions into a µVision project and usually you use uint8_t instead of char and bool. Is there any downside to using bool? I mean including the bool.h will not make the code significantly larger.

Parents
  • it's not about printing - it's about the intended use of the variable:

    • If the intended use of the variable is to hold an unsigned numerical value, use uint8_t;
    • If the intended use of the variable is to hold a signed numerical value, use int8_t;
    • If the intended use of the variable is to hold a printable character, use char.
Reply
  • it's not about printing - it's about the intended use of the variable:

    • If the intended use of the variable is to hold an unsigned numerical value, use uint8_t;
    • If the intended use of the variable is to hold a signed numerical value, use int8_t;
    • If the intended use of the variable is to hold a printable character, use char.
Children
No data