<div>  </div>
<div>   Thanks for the explanation, I knew the second example was wrong and what was the correct way to do it, just was not sure about--  </div>
<div>    "What makes it go wrong, precisely" ?<br>  <br></div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">
<div class="gmail_quote">On Fri, Jul 3, 2009 at 10:24 AM, Shakthi Kannan <span dir="ltr"><<a href="mailto:shakthimaan@gmail.com" target="_blank">shakthimaan@gmail.com</a>></span> wrote:<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>|  int c[5]={1,2,3,4,5};<br>|<br>|  int  *p;<br>|<br>|  *p=c;    //GCC gives a typecast<br></div>\--<br><br>It should be 'p = c'. On the left-hand side of the assignment there<br>should be an address or LVALUE. On the right-hand side of the<br>
assignment you should have a value or RVALUE. When you do *p on the<br>left-hand side of the assignment, you are dereferencing the address or<br>pointer, to get a RVALUE. Hence, the error.<br><br></blockquote></div></div>
</blockquote>
<div>        I know what the correct way should be ( p=c, as also explained by shakti above) .I wanted to know what happens when we do a wrong assignment (as in what the compiler internally does).I guess Shakti's explaination above suffices. </div>

<div>   </div>
<div>        Anyone who might want to comment further is please welcome.</div>
<div> </div>
<div> </div></div>
<div></div><br>-- <br>Hermes<br>Think Free, Think Open Source<br>