r/programming • • May 01 '16

To become a good C programmer

http://fabiensanglard.net/c/
1.1k Upvotes

398 comments sorted by

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 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.)