Are the outer parentheses in return statements really optional?

Q

Are the outer parentheses in return statements really optional?

✍: Guest

A

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.)

2015-02-02, 1189👍, 0💬