Assignment to non-void functions (returning nothing) can change the values?
<p>I encountered this problem in my program which was creating problems. so let me explain it by a example:</p>

<pre><code>#include&lt;iostream&gt;

int func(){
        if(1==0) return 100;
}

int main(){

        int x=99;
        x= func();
        std::cout&lt;&lt;"Value of x: " &lt;&lt; x &lt;&lt;std::endl;
}
</code></pre>

<p>I had thought the output will be <code>99</code> but output is <code>0</code> , so what's going on here?</p>
