max variable name length

Is there a maximum variable name length in C++? What happens if one exceeds this limit?

Are there any known issues from implementation to implementation?

Thanks.
Matt.

Comments

  • : Is there a maximum variable name length in C++? What happens if one exceeds this limit?
    :
    : Are there any known issues from implementation to implementation?
    :
    : Thanks.
    : Matt.
    :

    MSVC++6 truncates then to 255 characterrs. Don't know what other compilers do.

  • : : Is there a maximum variable name length in C++? What happens if one exceeds this limit?
    : :
    : : Are there any known issues from implementation to implementation?
    : :
    : : Thanks.
    : : Matt.
    : :
    :
    : MSVC++6 truncates then to 255 characterrs. Don't know what other compilers do.
    :
    :

    I thought it was 260 since _MAX_PATH == 260 ?
  • :
    : I thought it was 260 since _MAX_PATH == 260 ?
    :
    Well, I tried it again. I got that error message because I compiled for debug mode. Change to release mode and could get no errors or warnings regardless of how large I made the variable name. After about a thousand characters I gave up.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories