I'm working on a small networking application that uses byte arrays. Traditionally these would be declared with something like char buf[] = ...
.
This seems to be how it is (still?) done in most tutorials, yet it has the problem that it may obscure what is actually happening, for example when you try to print such an array and forget that not every char is a visible character.
Some people have suggested that you should stop using chars
altogether and instead use the modern uint8_t
. I find that very appealing, mostly on the principle that explicit is better than implicit.
So, is there something wrong with declaring these kinds of arrays as uint8_t buf[] = ...
?