Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Are the outer parentheses in return statements really optional?

0
Posted

Are the outer parentheses in return statements really optional?

0

Yes. Long ago, in the early days of C, they were required, and just enough people learned C then, and wrote code which is still in circulation, that the notion that they might still be required is widespread. (As it happens, parentheses are optional with the sizeof operator, too, under certain circumstances.) References: K&R1 Sec. A18.3 p. 218 ISO Sec. 6.3.3, Sec. 6.6.6 H&S Sec. 8.9 p. 254 comp.lang.c FAQ list ยท Question 20.20 Q: Why don’t C comments nest? How am I supposed to comment out code containing comments? Are comments legal inside quoted strings? A: C comments don’t nest mostly because PL/I’s comments, which C’s are borrowed from, don’t either. Therefore, it is usually better to “comment out” large sections of code, which might contain comments, with #ifdef or #if 0 (but see question 11.19). The character sequences /* and */ are not special within double-quoted strings, and do not therefore introduce comments, because a program (particularly one which is generating C code as

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123