Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!psuvax1!rutgers!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!jh4o+ From: jh4o+@andrew.cmu.edu (Jeffrey T. Hutzelman) Newsgroups: comp.lang.c Subject: Re: Assignment in test: OK? Message-ID: <0atunAG00VosQ2nkcN@andrew.cmu.edu> Date: 7 Sep 90 14:21:00 GMT References: <1990Sep5.185451.25532@DRD.Com> , <1990Sep7.042759.3804@ux1.cso.uiuc.edu> Organization: Carnegie Mellon, Pittsburgh, PA Lines: 18 In-Reply-To: <1990Sep7.042759.3804@ux1.cso.uiuc.edu> John, Good idea; it works great as long as you aren't trying to compare 2 variables. However, I think the intent of the original code was to perform an assignment and then do a test on the result (look carefully; there's a > or < in there somewhere), similar to the following, which I use all the time: if ( ( file_ptr = fopen (filename, mode) ) == NULL ) { /* print a message and exit */ } ----------------- Jeffrey Hutzelman America Online: JeffreyH11 Internet/BITNET:jh4o+@andrew.cmu.edu, jhutz@drycas.club.cc.cmu.edu >> Apple // Forever!!! <<