Another silly question

Farrell Woods ftw at masscomp.UUCP
Sat Apr 29 00:40:43 AEST 1989


In article <2459 at nmtsun.nmt.edu> kelly at titan.nmt.edu (Sean Kelly) writes:

>My CS instructor and I disagree about a certain moot point.  I have a text
>book which says that

>	*(a + i)	and	a[i]

>are equivalent, given an array a, and int index i ... each gives the
>value stored in a[i].  But he says that

>	*(a + i)

>is non-standard and would not expect it do go far on all _real_ C compilers

[deleted]

>What do you think?

I think your Sun and your Vax are better authorities on C than your instructor.
So are you, for that matter.  If the Sun and Vax compilers aren't "real" in
your instructors terms, whaich compilers are?

What you describe is simple pointer math.

Find a K&R 1 and have your instructor start reading at the paragraph beginning
near the top of page 94.

-- 
Farrell T. Woods				Voice:  (508) 392-2471
Concurrent Computer Corporation			Domain: ftw at masscomp.com
1 Technology Way				uucp:   {backbones}!masscomp!ftw
Westford, MA 01886				OS/2:   Half an operating system



More information about the Comp.lang.c mailing list