Doubt about array's name



In the following function, s shouldn't be a pointer costant (array's name)?

So why it is legal its increment? Thanks in advance.

/* Code starts here */
void chartobyte (char *s) {

while (s!=0) {
printf ("%d", *s);
s++;
}
/* Code ends here */
.



Relevant Pages

  • Re: A couple of things from H&S
    ... The authors claim that the former statement does not increment j, ... argument unless the argument is a VLA type. ... of char. ...
    (comp.lang.c)
  • Re: Is this kosher?
    ... Causes all sorts of subtle programming problems. ... char *p = q; ... A decent compiler will ... if you increment p you do not increment q. ...
    (comp.lang.c)
  • Re: *p++ = *q++ undefined? why?
    ... void strcpy(char *s, char *t) ... As far as I can see, the assignment expression here will 'run' like ... increment s then t, OR, increment t then s. ...
    (comp.lang.c)
  • A couple of things from H&S
    ... bought a currently-valid reference. ... The authors claim that the former statement does not increment j, ... of char. ...
    (comp.lang.c)
  • Re: Is this kosher?
    ... char *p = q; ... if you increment p you do not increment q. ... So you've got a potentially nasty ... When you further start messing about with the scope of the variables, ...
    (comp.lang.c)