Path: utzoo!attcan!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: Standard indentation? Message-ID: <2422@ficc.uu.net> Date: 12 Dec 88 02:02:36 GMT References: <1988Dec8.173158.11839@utzoo.uucp> <846@starfish.Convergent.COM> Organization: SCADA Lines: 30 In article <846@starfish.Convergent.COM>, jerry@starfish.Convergent.COM (Gerald Hawkins) writes: > Here is a confusing one: > Is it ever ok to use the form: > if (a = b * 2 + 39) /* intentional assignment within condition > */ Yes, but probably only in the common idiom: if((var = func(...)) == STATUS) { Such as: if((fp = fopen(...)) == NULL) { perror(...); return FAILURE; } or: if((nextc = getchar()) != EOF) { ... } -- Peter da Silva `-_-' Ferranti International Controls Corporation "Have you hugged U your wolf today?" uunet.uu.net!ficc!peter Disclaimer: I accept full responsibility for my typos. peter@ficc.uu.net