From: utzoo!decvax!harpo!floyd!vax135!ariel!and Newsgroups: net.lang.c Title: What is the difference Article-I.D.: ariel.340 Posted: Fri May 13 09:57:16 1983 Received: Thu May 19 06:32:53 1983 In c-language, logical expressions are evaluated only enough to determine truth or falsity of the entire expression, so the p++ in (2) may not be reached - regardless of the ORDER of evaluation. There are, at least, two solutions. 1) One is Coltoff's 1). Why must the ++ be inside? 2) Shift the endpoints of the range of p so as to use ++p in the first place it is used. Thus it is always evaluated. This may be tricky, and in the sense that one needs to be certain of the order, may be harder. For example, suppose the if-expression is a tautology and always TRUE, and suppose the c-compiler were smart enough to recognize that fact. Then no part of the expression would have to be evaluated. Richard