是什么ssize_t供和ptrdiff_t的区别? [英] What is the difference between ssize_t and ptrdiff_t?
问题描述
C标准(ISO / IEC 9899:2011和9899:1999)的定义类型 ptrdiff_t的
< STDDEF.H>
。
POSIX标准(ISO / IEC 9945; IEEE标准1003.1-2008)定义了一个类型 ssize_t供
< SYS / types.h中>
。
- 什么是这些类型之间的差异(或者为什么均被认为有必要)?
- 是那里的底层基本类型为
ssize_t供
不一样的ptrdiff_t的
实施?
有没有实现,其中的底层基本类型为ssize_t
是不一样的ptrdiff_t的
块引用>x86-16与大内存模型。指针是远(32位),但个别对象仅限于一个段(因此
为size_t
允许是16位)。The C standard (ISO/IEC 9899:2011 or 9899:1999) defines a type
ptrdiff_t
in<stddef.h>
.The POSIX standard (ISO/IEC 9945; IEEE Std 1003.1-2008) defines a type
ssize_t
in<sys/types.h>
.
- What is the difference between these types (or why were both deemed necessary)?
- Is there an implementation where the underlying base type for
ssize_t
is not the same as forptrdiff_t
?解决方案Is there an implementation where the underlying base type for ssize_t is not the same as for ptrdiff_t?
x86-16 with the large memory model. Pointers are far (32-bit), but individual objects are limited to one segment (so
size_t
is allowed to be 16-bit).这篇关于是什么ssize_t供和ptrdiff_t的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!