Answer to Question #8467 in Other Programming & Computer Science for hatem el-azab
to make sense if i'm understand it correct in c99 the first 63 are significant is it because the all character combinations included in 63 characters as(26 for upper cases alpha,26 for small alpha,0-9 and 1 letter for universal letters)...if what i understand is correct so why 31.
First of all, the C is a compiled language. So, before execution the source code& should& be translated into machine codes. This action is performed by compiler.& To transform C code into binaries for specific architecture, we should use the platform-specific compiler.
C is intended to be cross-platform language. So the same C code should be accepted by different compilers without need of significant corrections.
The compiler deals with numerous platform limitations. The limitation that directly concerns your question is system linker`s naming convention.
The C standards were issued keeping in mind different system limitations to ensure code portability between architectures. The previous standard, the C 89 or ANSI C contained more strict rules for identifiers mentioned in your question:
• Only 6 characters were significant (variables foobar and foobar1 were considered as the same variable)
• Case& insensitivity (variables FOObar and fooBAR were considered as the same variable)
Such limitations were implemented to keep portability with mainframe environments widely used those days.
The next C99 standard reflects changes in popular architectures. The limitations became less strict, and& requirements for the internal identifiers followed them. But the same rule applies – if even specific OS supports longer identifiers names, we should stick to 31 character to keep portability with& other systems.
List of references:
http://stackoverflow.com/questions/2352209/max-identifier-length& - discussion& of topic on stackoverflow.
http://home.datacomm.ch/t_wolf/tw/c/c9x_changes.html comparison between C89 and C9x
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!