Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-tgr!ron From: ron@brl-tgr.ARPA (Ron Natalie ) Newsgroups: net.lang.c Subject: Re: Pointer Trouble Right Here in Unix City Message-ID: <11111@brl-tgr.ARPA> Date: Tue, 28-May-85 21:54:02 EDT Article-I.D.: brl-tgr.11111 Posted: Tue May 28 21:54:02 1985 Date-Received: Thu, 30-May-85 04:24:17 EDT References: <179@gatech.CSNET> Distribution: net Organization: Ballistic Research Lab Lines: 28 > case 'b': > *(*argv + 2) ? *argv += 2 : argv++; > It's upset because the "true" expression and the "false" expression are of different. Turn to page 191 in K&R and read along with me: "If both are pointers of the same type, the result has the common type, otherwise, one must be a pointer and the other the constant 0" A disgusting fix is to make the false expression "*argv++" I don't know why people have an aversion to readable code. First what is wrong with an IF/ELSE combination here? It's what you are doing. You are not selecting one of two expressions, but choosing to do one evaluation or the other. It's up to you, but it seems muddle- some to me. My bigger complaint is *(*argv + 2) Give me a brake they put the brackets in C so you wouldn't have to do every- thing with *. How about argv[0][2] ???