"abcdef"[3] == 3["abcdef"], but why?

Bjorn Engsig bengsig at oracle.nl
Mon Oct 2 18:58:55 AEST 1989


Article <19883 at mimsy.UUCP> by chris at mimsy.UUCP (Chris Torek) explains
how the compiler could/does handle 3["abcde"].  This was very well done,
except that 3["abcde"] actually evaluates to the char 'd' and not 'c'.

I'm sure that Chris nows that C arrays start with index 0, right Chris :-)
-- 
Bjorn Engsig, bengsig at oracle.nl, bengsig at oracle.com, mcvax!orcenl!bengsig



More information about the Comp.lang.c mailing list