@user3707023 so s points at the first character of the input string and *s will be one of 48 (character 0), 49 (character 1) or 0 (null which terminates the string). the easiest way to swap the 48s and 49s is to XOR them with 1 (which toggles the least significant bit). that's basically *s^=1;.
in order to loop, the solution uses recursion. if *s isn't zero yet (that is, we're not at the end), i is called recursively on the remainder of the string before 1 is returned to toggle the current character. otherwise the ternary operator returns 0 so as not to mess with the null which terminates the string.
@MartinEnder Awesome, thank you for that response. I have to admit I still haven't fully understood it, but I will read your explanation several more times tonight and tomorrow and hopefully I can fully understand how it works.
By the way, I chose to post this question here rather than making a normal stack overflow question because I figured I would just get downvotes... You know what I'm talking about right? My follow-up question is... why specifically does this kind of question get downvoted and is this the best place on the net to be asking this question about that line of code?
I think it would have been worth a try on SO. If you explain in a bit more detail which parts of the code you're having trouble with and what you've tried to figure it out, I think it should be a perfectly acceptable question. They don't like questions asking for how to golf things, but I don't think they have a problem with trying to understand why obscure code works.