TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: Zack Sessions 76407,1524 (X)
from: Bruce MacKenzie 71725,376
date: 1990-05-30 23:38:12
subject: #4014-#C and JOoysticks

#: 4017 S3/Languages
    30-May-90  23:38:12
Sb: #4014-#C and JOoysticks
Fm: Bruce MacKenzie 71725,376
To: Zack Sessions 76407,1524 (X)

Zack,
     Of the three books on C in my library, Purdum always uses parentheses,
Gehani never does and Hogan says they're not required but that many use them
for clarity.  There is a diversity in this usage and I would say that any
compiler that required parentheses with return is definitly non-standard.  It
is a question of style and I think the most compelling argument is Occam's
Razor--why hit the shift key if you don't need to. Still I think a line like:

 return (strcmp(s1,s2)==1) ? s1 : s2;

does benefit by being written

 return((strcmp(s1,s2)==1) ? s1 : s2);

although the two do compile the same.

There is 1 Reply.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.