Carramba <> writes:
> On Sun, 13 Feb 2005 21:56:03 GMT, Keith Thompson <kst-> wrote:
[...]
> thanx for answer, but Iam not affraid of runing into this proglem, it
> only for educational purpose. So my questions stil unanswered?!
> would it work to assgin first variable with 8 characters in lenght
> name value, and then assign different value to 8+ long variable and
> call the first one? should compiler (theoreticly) re-assign second
> value to first variable if it coudn't hanle londer then 8 chars
> variable names?
>
> ex
> char Test_var;
> char Test_variable;
> Test_var='Y';
> Test_varibla='N';
> printf("In case of sussces you se Y & N , otherwise N & N\n%c & %c",
> Test_var, Test_variable);
>
> should something like that work?
Test_var and Test_variable appear to be internal identifiers, so
they're absolutely guaranteed by both C90 and C99 to be distinct.
Unless you're using external identifiers, you can always count on 31
significant characters. Your implementation is required to document
what its actual limit is.
If you had something like this:
char this_is_a_very_long_identifier_1; /* 32 characters long */
char this_is_a_very_long_identifier_2;
this_is_a_very_long_identifier_1 = 'Y';
this_is_a_very_long_identifier_2 = 'N';
you could conceivably run into problems on an implementation that
actually limits identifers to 31 significant characters. The standard
says that "If two identifiers differ only in nonsignificant
characters, the behavior is undefined", so there's no way to tell what
the program is going to do.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.