Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
In other words you point
p
to the value ofx
as an address (it's not forbidden to do it until you do use this address)And then using the index operation you get the new address added by the value of
y
and because the size ofchar
is one you got exactly what you need...Great!
But under the hood the forbidden addition is still used...
So it's a hack...
(cool)
It uses pointer arthmatic.
When you have pointer p.
&p[n] is just equal to p + n*sizeof(p[0]).
p is pointer to char, so sizeof(p[0]) is 1
Hi Etothetaui. I'm not doing translations into C right now. This kata has a version in ruby and I got ready a javascript version that will be released in some days.