Working with blocks?
<p>In an interview I recently attented I was asked to predict the output of a code segment. Even if I got it right, I was not able to explain how got it.
This is the code segment.</p>

<pre><code>int num =2;
int (^ myblock)(void)=^{
    return num*5;
};

NSLog(@"my block  call 1  %d",myblock());
num = 5;
NSLog(@"my block  call 2  %d",myblock());
</code></pre>

<p>Can anybody explain why the answer is 10 both times.?
Thanks</p>