Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!cartan!brahms!ballou From: ballou@brahms (Kenneth R. Ballou) Newsgroups: comp.lang.c Subject: Re: incrementing after a cast Message-ID: <491@cartan.Berkeley.EDU> Date: Sat, 6-Dec-86 21:35:55 EST Article-I.D.: cartan.491 Posted: Sat Dec 6 21:35:55 1986 Date-Received: Sun, 7-Dec-86 05:21:49 EST References: <349@apple.UUCP> <7376@utzoo.UUCP> <1746@batcomputer.tn.cornell.edu> Sender: daemon@cartan.Berkeley.EDU Reply-To: ballou@brahms (Kenneth R. Ballou) Organization: Math Dept. UC Berkeley Lines: 13 Keywords: cast, increment, postincrement In article <1746@batcomputer.tn.cornell.edu> braner@batcomputer.UUCP (braner) writes: >If ((sometype *)pointer)++ is not legal, then the law should be changed! Why? >(since the pointer-type cast is legal, why can't you use the resulting >pointer like any pointer of sometype?) You can use the *VALUE* of the pointer in exactly the same way as you could use the *VALUE* of any other pointer. Keep in mind that the pre/post-increment operator requires one of those mythical beasts, an l-value. Likewise, you could not apply pre/post-increment to the result of a function call.