的C结构的大小限制 [英] Size limitation of C structure

查看:91
本文介绍了的C结构的大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有对C结构的大小限制?如果一些任何一个可以告诉还有什么限制。

Is there any size limitation for C structure ? if some can any one tell what is there limitation.

推荐答案

从C标准:

5.2.4.1翻译限制

1的执行应能够翻译和执行的至少
  包含的每一个的至少一个实例一个节目
  以下限制:

1 The implementation shall be able to translate and execute at least one program that contains at least one instance of every one of the following limits:

...
   - 65535字节的对象(在托管环境中唯一的)结果
  ...
   - 1023成员在一个单一的结构或联合结果
  ...
   - 在一个63级的嵌套结构或联合定义
  结构声明列表
  ...
  13)实现应该避免强加固定的翻译限制
  只要有可能。

... — 65535 bytes in an object (in a hosted environment only)
... — 1023 members in a single structure or union
... — 63 levels of nested structure or union definitions in a single struct-declaration-list ... 13) Implementations should avoid imposing fixed translation limits whenever possible.

除此之外,上限为 SIZE_MAX (为最大值为size_t )。

Other than that, the upper bound is SIZE_MAX (maximum value for size_t).

这篇关于的C结构的大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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