开发者

What would be a do nothing operator for a function returning void?

开发者 https://www.devze.com 2022-12-19 11:13 出处:网络
I want to return nothing inside a function returning v开发者_StackOverflow社区oid. How would I do that?You can do one of two things:

I want to return nothing inside a function returning v开发者_StackOverflow社区oid. How would I do that?


You can do one of two things:

  1. Structure the flow of the code so that there is no need for a return statement.
  2. Place return; statements where you want the function to return control to the caller.

EDIT: To clarify, return; is a statement that returns control to the caller without yielding a value.

That's basically it.


i think sending a message to nil is a no-op

[nil message]

Sending a message to nil?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号