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.
Sorry I do not undertand that, could u plz explain
You're welcome, cheers!
The trick with implicit conversion (boolean to integer):
👍 Very interesting kata. Thanks!
you don't need to create
i
ort
, in addition you're also copying a for no reason.Why did you change the parameters? What if this was an algorithm written by someone else and you just bricked some of the code...
Why? Test several sequences and find a pattern.
Is this cheating? :)
Thank you :)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I like
UPD:
next( &c )
is a valid address for dereference. There will be a data character or a null-terminator.basic_string
is implemented as:[ size_t __cap_ ][ size_t __size_ ][ char* __data_ (ends with \0) ]
UPD: After some research and tests, I've noticed, that Clang 8 implements strings with a null-terminator in the memory layout. Technically, I dereference not
std::string::end
(which would be UB), but the address in memory, where\0
is located.Trying to access the next character with &c might give you a bad memory address because it's getting the address of the reference variable c and not necessarily the next character in the string.
Loading more items...