We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Sorry for the basic question, but why does it not return a pointer to an unsigned char? I mean, I looked in K&R but it does explain the rational (as far as I could tell...)
Thanks
The trouble comes with compilers that try to be (too) helpful by warning whenever you have a signed/unsigned mismatch (especially via pointers).
So, if you've carefully defined all your text as 'unsigned', you can get loads of warnings with the string library functions...
:-(
Therefore I have three typedefs in my header:
U8 - for 8-bit things that specifically need to be unsigned;
S8 - for 8-bit things that specifically need to be signed;
TXT - for things that are "text" and, therefore, likely to be used with the string library functions.
Thanks - That's an interesting one.
So don't do that, then! :-)
I don't (any more) !
The point is that having just U8 and S8 (or equivalent) is not sufficient - you do also need some kind of "unadorned" char...