Path: utzoo!attcan!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.misc Subject: Re: Pointers as 3-tuples (Re: JLG's flogging of horses (was Re: Relationship between C and C++)) Message-ID: Date: 7 Apr 90 18:02:29 GMT References: <5.Q2H42xds13@ficc.uu.net> <14309@lambda.UUCP> Reply-To: peter@ficc.uu.net (Peter da Silva) Organization: Xenix Support, FICC Lines: 23 In article <14309@lambda.UUCP> jlg@lambda.UUCP (Jim Giles) misses the point and goes off on a tangent: > Well, as has already been pointed out, the pA=A assignment is actually > _illegal_ in C. It's not illegal in C. It's an implicit type-cast on assignment. To avoid a warning you must now use: pA = (t *)A; > As for "known at compile time" - well, N and M aren't if they were > passed as parameters. Sure, because A was passed as a 3-tuple. N and M aren't known explicitly unless declared, but N*M is known. And that's all you need to bound-check this baby. The point I'm making isn't that array indexing is or is not better than pointers, but that for the purpose at hand neither array indexing or pointers is better or worse at bounds checking. Just think of *A as a shorthand for A[0]. -- _--_|\ `-_-' Peter da Silva. +1 713 274 5180. . / \ 'U` \_.--._/ v