最大长度标识符 [英] Max identifier length

查看:232
本文介绍了最大长度标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在哪里可以找到什么是在C标识符最大长度是多少?

Where can I find what is the maximum identifier length in C?

在这头文件指定的限制?

推荐答案

有没有头文件包含标识符长度的限制;即使有,怎么可能帮你?根据反正头文件中的值在编译时你不能改变你的标识长度。

There is no header file to contain the identifier length limit; even if there were, how could it help you? You can't change your identifier lengths at compile time based on a value in a header file anyway.

借助 C标准,部分5.2.4.1说:

The C standard, section 5.2.4.1 says:


      在内部标识符或宏名
  • 63显著初始字符(每个通用字符名称或扩展源字符被视为单个字符)

  •   在外部标识符
  • 31显著初始字符(每个通用字符名指定的0000FFFF或以下的短标识符被认为是6个字符,每个通用字符名指定的00010000以上的短标识符被认为是10个字符,而每个扩展源字符被认为是相同的字符数作为相应的通用字符名称,如果有的话)

  •   

它还包含了一个注脚:

实现应该避免强加固定的翻译限制只要有可能。

Implementations should avoid imposing fixed translation limits whenever possible.

所以,你应该检查你的文档,看看你的编译器支持的显著字符的标识符更大一些。

So you should check your documentation to see if your compiler supports a greater number of significant characters in identifiers.

这篇关于最大长度标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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