是什么ssize_t供和ptrdiff_t的区别? [英] What is the difference between ssize_t and ptrdiff_t?

查看:122
本文介绍了是什么ssize_t供和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 for ptrdiff_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆