是u_char一个标准? [英] Is u_char a standard?
问题描述
如果u_char是一个标准只是好奇。我一直用它假定它与uintX_t类型等一起定义。但我看到了一些我们的code基的转型从u_char为无符号的字符有原因,使用户不必定义u_char自己。
Just curious if u_char is a standard. I've always used it assuming it was defined along with uintX_t types and so on. But am seeing some of our code base transition from u_char to "unsigned char" with a reason "so users don't have to define u_char themselves"..
推荐答案
字符串 u_char
不会出现在这个C标准的草案:
The string u_char
does not appear in this draft of the C standard:
<一个href=\"http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf\">http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf
它不是通过POSIX要求要么,据我所知。
It's not required by POSIX either, as far as I know.
我认为这是BSD(SYS / types.h中),和Windows(WINSOCK.H)。我不会考虑任何一个是标准 - 他们不是正式的标准,他们肯定不是标准C的一部分,但他们都有明确的规定和记录
I think it's in BSD (sys/types.h), and Windows (winsock.h). I would not consider either one to be "a standard" - they aren't formal standards, and they certainly aren't part of standard C, but they are clearly defined and documented.
这篇关于是u_char一个标准?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!