zoukankan      html  css  js  c++  java
  • C标准库与嵌入式

    stddef.h,其中包括size_t,sizeof函数返回值,不同平台的大小不一致

    Size and pointer difference types[edit]

    The C language specification includes the typedefs size_t and ptrdiff_t to represent memory-related quantities. Their size is defined according to the target processor's arithmetic capabilities, not the memory capabilities, such as available address space. Both of these types are defined in the <stddef.h> header (cstddef header in C++).

    size_t is an unsigned integer type used to represent the size of any object (including arrays) in the particular implementation. The sizeof operator yields a value of the type size_t. The maximum size of size_t is provided via SIZE_MAX, a macro constant which is defined in the <stdint.h> header (cstdint header in C++). size_t is guaranteed to be at least 16 bits wide. Additionally, POSIX includes ssize_t, which is a signed integral type of the same width as size_t.

    ptrdiff_t is a signed integral type used to represent the difference between pointers. It is only guaranteed to be valid against pointers of the same type; subtraction of pointers consisting of different types is implementation-defined.

  • 相关阅读:
    架构阅读笔记4
    python读取docx内容
    python转换doc为docx
    使用Navicat连接oracle问题及解决
    扩充虚拟机磁盘
    虚拟机无法打开内核
    六个常见属性场景
    架构阅读笔记3
    架构学习
    PHP中的加密方式有如下几种
  • 原文地址:https://www.cnblogs.com/yanhc/p/8669576.html
Copyright © 2011-2022 走看看