|
|
On 12/05/2011 1:19, Darren New wrote:
> On 5/11/2011 13:27, Warp wrote:
>> C# isn't C++...
>
> I know that. I'm just saying that I was surprised it worked in C++
> because everything I've ever read except the standard implies it
> shouldn't. Every tutorial etc etc etc says "You can't put a value after
> a return in a void function, and you have to put a value after a return
> in a non-void function." So it surprised me this was actually not true
> for C++. So I figured I'd try specifically for C#, because maybe all the
> tutorials for *that* were wrong. :-)
except that your "value" is actually a non-value by itself:
the function "bar" doesn't return anything, so if "foo" returns the
return-value of "bar", it also doesn't return anything.
I suppose it wouldn't work if "bar" really had a return-value.
cu!
--
ZK
Post a reply to this message
|
|