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
Hello! would it be fine to ask if you can explain what the return statement does? I don't think I've encountered this math statement before
Could have written same thing as:
if ((*q++ = *p) == 0) break;
or
if (!(*q++ = *p)) break;
I am actually dumb, I basically strictly defined behavior instead of using the strcmp() function.
I see, I think I understand it now. Thanks a lot :)
There are a few things going on...
'\0'
then the "result" of that assignment would also be 0, so in that casebreak
from he loop*p
was not 0), then q pointer will be post-incremented; (the p is post incremented by the for loop)Hey man, I'm pretty much a beginner to C code, especially when it comes to string manipulation, can you explain to me what happens to the line:
if ((*q++ = *p) == '\0') break;
Greatly appreciated my guy :)