Is return an operator or a function?
Posted
by eSKay
on Stack Overflow
See other posts from Stack Overflow
or by eSKay
Published on 2010-05-06T12:58:54Z
Indexed on
2010/05/06
13:08 UTC
Read the original article
Hit count: 191
This is too basic I think, but how do both of these work?
return true; // 1
and
return (true); // 2
Similar: sizeof
, exit
My guess:
If return was a function,
1
would be erroneous.So, return should be a
unary operator
that can also take in brackets... pretty much likeunary minus
:-5
and-(5)
, both are okay.
Is that what it is - a unary operator?
© Stack Overflow or respective owner