什么是通用(构建)系统上C / C ++标识符的最大长度? [英] What is max length for an C/C++ identifier on common (build) systems?

查看:144
本文介绍了什么是通用(构建)系统上C / C ++标识符的最大长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不记得标准说的标识符的最大长度,所以在理论上,他们可以。在实际生活中,这些名称至少可以受到编译器和链接器实现的限制。

I don't remember the standard saying something of the max length for identifiers so in theory they can be long. In real life, those names could be limited by at least the compiler and linker implementations.

这应该适用于所有系统

int a;

此代码段

#!/usr/bin/perl
print "int" . "b" x 2**16 . ";";

创建一个declarationen,未定义引用 std :: 在编译/链接(使用gcc / mingw)时, ld 有些。

creates a declarationen that gives undefined reference to std::somethings with ld while compiling/linking (using gcc/mingw).

对不同系统上的标识符的限制?

So what are the size limits for an identifier on different systems?

推荐答案


  • Microsoft C ++ :2048个字符

  • Intel C ++ :2048个字符

  • g ++:没有限制,请回答此问题: g ++变量名称有长度限制吗?

    • Microsoft C++: 2048 characters
    • Intel C++: 2048 characters
    • g++: No limit, as answered in this question: is there a length limit on g++ variable names?
    • 这篇关于什么是通用(构建)系统上C / C ++标识符的最大长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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