On 4/21/10 3:26 PM, Jeff Newmiller wrote:
>> There are many ways to skin a cat, here's one:
>>
>> void reverse(int forward[], int backward[], unsigned int n) {
>> unsigned i = n;
>> while(i--> 0) {
>> backward[n-i-1] = forward[i];
>> }
>> }
>
> This reverses and then re-reverses it.
Nope, just reverses it once. I'll admit, it isn't an idiomatic
construction, but it uses an unsigned index that counts down to reverse
an array since that's what Brian seemed to be after.
_______________________________________________
vox-tech mailing list
[email protected]
http://lists.lugod.org/mailman/listinfo/vox-tech