Or it will run until you run out of ram or rom space, assuming you can access all of the ram/rom space you are pointing to.<div>...</div><div>Just thought of something, the code does not say while((*x++ <b><font class="Apple-style-span" color="#ff0000">==</font></b> *y++)){},</div>
<div>thus the value y is pointing to, incremented by one, should always be able to <b>successfully </b>be stored in the register x is pointing to, even if the value in *x is incremented before the store.</div><div>Thus == to while(1){}</div>
<div><br></div><div>Cheers,</div><div>Pieter.<br><br><div class="gmail_quote">On Thu, Aug 4, 2011 at 8:53 AM, Andre Renaud <span dir="ltr">&lt;<a href="mailto:andre@bluewatersys.com">andre@bluewatersys.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 03/08/11 22:13, Volker Kuhlmann wrote:<br>
&gt; On Wed 03 Aug 2011 11:40:03 NZST +1200, Charles Manning wrote:<br>
&gt;<br>
&gt;&gt; In my books there is also a very hot place reserved for those who write things<br>
&gt;&gt; like<br>
&gt;&gt; while((*x++ = *y++)){}<br>
&gt;<br>
&gt; You can&#39;t really compare this with previous examples. This one is much<br>
&gt; different because it is undefined, unpredictable and therefore useless<br>
&gt; and much worse. Your choc fish challenge was defined in its behaviour<br>
&gt; and predictable, although extremely bad programming and a convoluted way<br>
&gt; to say while(1); .<br>
<br>
</div>I don&#39;t think this is undefined - isn&#39;t this a simple implementation of<br>
strcpy (assuming x &amp; y are char *)? It will continue around until it<br>
assigns a 0 pointer, at which point it will stop. It would be undefined<br>
if you had *x++ = *x++.<br>
<br>
Regards,<br>
<font color="#888888">Andre<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
<a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
Meetings 3rd Monday each month at Tait Radio Communications, 175 Roydvale Ave, 6.30pm<br>
<br>
When replying, please edit your Subject line to reflect new content.<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Pieter Britz<br>+64 201 2374835<br><a href="mailto:pabritz@gmail.com">pabritz@gmail.com</a><br>New Zealand<br>
</div>