Are parentheses around the result significant in a return statement?

前端 未结 11 2369
感情败类
感情败类 2020-11-27 12:07

Is there a difference between these two statements inside a function?

bool returnValue = true;
// Code that does something
return(returnValue);
11条回答
  •  醉话见心
    2020-11-27 12:38

    There is no difference.

    One reason to use parenthesis would be if you wanted to evaluate an expression before returning but in your example, there would be no reason. See:

    Parenthesis surrounding return values

    for further discussion.

提交回复
热议问题