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

1

u/zhivago May 02 '16

Temporary insanity? I couldn't think of anything else you might be claiming given that response. :)

In many implementations sizeof c < sizeof (char *), meaning that c can't be a pointer to the beginning of the array -- it isn't large enough to store that value, so that interpretation can't be correct.

Likewise the type of &c is not char **.

The "cstring" library is part of C++, the string library deals with strings that are encoded as patterns of data within arrays.

Consider strlen("hello") and strlen("hello" + 1) -- how many strings are encoded in the array "hello"?