Do you prefer to see something like t_byte* (with typedef unsigned char t_byte) or unsigned char* in code?
I’m leaning towards t_byte in my own libraries, but have never worked on a large project where this approach was taken, and am wondering about pitfalls.
If you’re using C99 or newer, you should use
stdint.hfor this.uint8_t, in this case.C++ didn’t get this header until C++11, calling it
cstdint. Old versions of Visual C++ didn’t let you use C99’sstdint.hin C++ code, but pretty much every other C++98 compiler did, so you may have that option even when using old compilers.As with so many other things, Boost papers over this difference in
boost/integer.hpp, providing things likeuint8_tif your compiler’s standard C++ library doesn’t.