[chbot] !!!!!!!! Choc fish challenge 2 !!!!!!!!!

Mark Beckett m.beckett at amuri.net
Mon Aug 1 04:54:56 BST 2011


And I thought I had trouble reading

This time the first correct answer after  8pm on Tuesday will win.


Mark



On 1/08/11 14:57, Andre Renaud wrote:
> Hi Charles,
>
> On 01/08/11 14:13, Charles Manning wrote:
>> Under what conditions does the following compile and what will happen when it
>> executes?
>>
>>    while(x[j] == j[x]){
>> 	j++; x++;
>>    }
> As far as I can tell, one of x or j has to be an ordinal/integer type.
> The other has to be some kind of array type. Since array indexing
> essentially becomes addition, x[j] is equivalent to j[x]. I think this
> means that it'll run forever.
>
> However, I'm not entirely convinced that typing of x[j] vs j[x] doesn't
> come into it, especially if the one of them that is an array has
> sizeof()>  1.
>
> Regards,
> Andre
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Web site: http://kiwibots.org
> Meetings 3rd Monday each month at Tait Radio Communications, 175 Roydvale Ave, 6.30pm
>
> When replying, please edit your Subject line to reflect new content.
>



More information about the Chchrobotics mailing list