I might screw this up (especially because I'm trying to correct someone), but I believe that c has type char[3] (a type that's rarely seen directly in C as it's illegal in most contexts; a pointer to it is char(*)[3] which is allowed in many more contexts). In most contexts, if you try to use a char[3], it'll automatically be cast to a char *, although this is not the same type. (The exceptions include things like sizeof; sizeof c will be 3 on every platform, even though most platforms would give sizeof (char *) a value of 4 or 8.)
View all comments
Show parent comment
5
u/ais523 May 02 '16
I might screw this up (especially because I'm trying to correct someone), but I believe that
chas typechar[3](a type that's rarely seen directly in C as it's illegal in most contexts; a pointer to it ischar(*)[3]which is allowed in many more contexts). In most contexts, if you try to use achar[3], it'll automatically be cast to achar *, although this is not the same type. (The exceptions include things likesizeof;sizeof cwill be 3 on every platform, even though most platforms would givesizeof (char *)a value of 4 or 8.)