Re: Sort of mystified from an earlier thread




pete wrote:
> Chad wrote:
> >
> > This was taken from the following:
> >
> > http://groups.google.com/group/comp.lang.c/browse_thread/thread/089dfb62c71802b3/663e9afae83d061c?hl=en#663e9afae83d061c
> >
> > And I quote:
> >
> > "Well, that's also ok for char**, since string literals are of type
> > char * in c. The general idea still stands, though.
> >
> > The thing that irritates me is that despite all this, it's _trivial_
> > to violate const in C without resorting to all this.
>
> You do realise that string literals represent arrays of char
> and are not pointer types, don't you?
>
> --
> pete

Yes, I do realize string literals represent array of chars.

.



Relevant Pages

  • Re: C Strings
    ... I thought string literals were arrays until you operated on them, ... int main ... char *p1; ...
    (comp.lang.c)
  • Re: Code Review? memory management in C
    ... pete writes: ... int main(int argc, char *argv) ... The form is intended to document the fact that the pointer argument ... is a pointer to an array rather than to a single object. ...
    (comp.lang.c)
  • Re: char *
    ... but will crash when execute? ... String literals should not be modified. ... char*, which gives a false impression that it can in fact be written to. ... initializer that can be used for char arrays: ...
    (microsoft.public.vc.language)
  • Re: can I use a pointer to step through memebers of structures?
    ... pete wrote: ... and that pointer must never be dereferenced). ... > Pointer arithmetic is defined in terms of arrays. ... > pointers to char, is when you have either a genuine array ...
    (comp.lang.c)
  • Re: UINT_MAX == INT_MAX possible?
    ... pete wrote: ... itoa should be implemented portably. ... void i_to_a(int n, char *s) ... you've been using Jacob's compiler on high redundant warning ...
    (comp.lang.c)