Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!tuvie!inst182 From: inst182@tuvie (Inst.f.Techn.Informatik) Newsgroups: comp.lang.c Subject: Re: Doctor C's Pointers Message-ID: <1741@tuvie> Date: 2 Aug 90 11:13:11 GMT References: <9@wotk.UUCP> Reply-To: inst182@tuvie.UUCP (Inst.f.Techn.Informatik) Organization: Technical University of Vienna, EDP-Center Lines: 29 root@wotk.UUCP (Superuser) writes: >I was reading the August issue of The C Users Journal and came across >this in Rex Jaeschke's article - >( It also allows expressions such as ) >( ) >( "abcd"[i] and f()[j] ) > ^^^^^ >I thought this was taboo. What's the story on this? Why should this be taboo? Provided f is declared as sometype * f (void) it returns a pointer to sometype, and I can subscript that pointer like any other pointer. After all, in C arrays are treated like pointers to their first element in almost any context. (Hope, the wording is correct, I don't want to go through that Arrays-are-not-pointers discussion again) Peter J. Holzer | _ | Peter J. Holzer | Think of it | | |_|_) | Technische Universitaet Wien | as evolution | | | | | hp@vmars.tuwien.ac.at | in action! | | __/ | ...!uunet!mcsun!tuvie!vmars!hp | Tony Rand |