hardcoded constants

Guy Harris guy at auspex.UUCP
Fri Dec 23 18:53:46 AEST 1988


>Last I heard sizeof("/") == sizeof(char *)

I don't know who you heard that from, but I suggest you take anything
else they have to say about C with a grain of salt; it is not true.  "/"
is an array of "char" with two elements, not a pointer to "char".  In
some contexts, that "array of 'char'" expression gets converted to a
"pointer to 'char'" that points to the array's first member; however,
"argument of the 'sizeof' operator" is not one of those contexts.



More information about the Comp.lang.c mailing list