Use of Const keyword in ANSI C

Larry Jones scjones at sdrc.UUCP
Sat Sep 10 08:06:04 AEST 1988


In article <441 at optilink.UUCP>, cramer at optilink.UUCP (Clayton Cramer) writes:
> [assignment to a "const char *" works without complaint]
>
> So have I missed something here in my understanding of 'const', or
> is the Microsoft compiler broke?

You've missed the binding order - "const char *" is a pointer to a constant
character, what you want is "char * const" which is a constant pointer to
a (non-constant) character.

----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones at sdrc.uucp
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150                  AT&T: (513) 576-2070
"Save the Quayles" - Mark Russell



More information about the Comp.lang.c mailing list