In plain C, the char
type is an at least 8 bits wide type with an implementation-defined signedness.
As the When to use the plain char type in C question's answers suggest, this type should be used when you have a data type which is string by intention and behaves like normal C strings, allowing to use for example string.h
's functions from the standard library.
However there could be scenarios when you need to do arithmetic on such values. An example could be UTF-8 data for which you would have to write some type of processor or display routine yourself (no appropriate library solution being available on your target).
How this situation could be handled in the safest, most portable manner?