Path: utzoo!yunexus!stpl!bbm!darcy From: darcy@bbm.UUCP (D'Arcy Cain) Newsgroups: comp.lang.c Subject: Re: register variable??? Message-ID: <789@bbm.UUCP> Date: 11 Sep 89 17:29:19 GMT Article-I.D.: bbm.789 References: <30585@srcsip.UUCP> Reply-To: darcy@bbm.UUCP (darcy) Organization: BBM Bureau of Measurement, Toronto Lines: 20 In article <30585@srcsip.UUCP> sklee@srcsip.UUCP () writes: > while (i < 4) list[i] = list[++i]; I have always been too scared to take a chance on this type of code. It seems to me that it is subject to compiler interpretation as to when the ++ operator is applied. Example on the first iteration: list[0] = list[1]; or list[1] = list[1]; I don't actually know if either is guaranteed by some standard but even if it is I wouldn't want to depend on such a guarantee on a specific compiler having seen how some of them implement "standards". I would use the following replacement for the above line: for (i = 0; i < 4; i++) list[i] = list[i + 1]; which keeps the increment out of the loop. D'Arcy J.M. Cain (darcy@bbm, darcy@cain)