0

What is the maximum limit for the number of characters in a variable name in C++, if any? I am using a g++ compiler.

Cyrus
  • 84,225
  • 14
  • 89
  • 153
Abishek
  • 5
  • 3

1 Answers1

1

According to https://gcc.gnu.org/onlinedocs/gcc/Identifiers-implementation.html

For internal names, all characters are significant. For external names, the number of significant characters are defined by the linker; for almost all targets, all characters are significant.

So it is implementation/target specific and you will have to check the documentation for your one.

Yunnosch
  • 26,130
  • 9
  • 42
  • 54