Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

-1 from ceilingcat
Source Link
LambdaBeta
  • 2.8k
  • 13
  • 20

C (gcc), 44(削除) 44 (削除ここまで) 43 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x*o|*r&&x(o+1,r+1,*o^=*r):0;;}

Try it online! Try it online!

Uses recursion, note that to print strings containing the null byte one will have to manage the strings as arrays. (See the footer of the link for an example)

C (gcc), 50(削除) 50 (削除ここまで) 49 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x*o|*r&&x(o+!!*o,r+!!*r,*o^=*r):0;;}

Try it online! Try it online!

Slightly safer version (doesn't read past end of strings, requires enough memory to exist past them though - a la strcpy).

C (gcc), 61(削除) 61 (削除ここまで) 60 bytes

x(b,o,r)char*b,*o,*r;{*o|*r?*b=*r^*o,x*o|*r&&x(b+1,o+!!*o,r+!!*r,*b=*r^*o):0;;}

Try it online! Try it online!

As safe as any standard C function taking a buffer, at the cost of a few more bytes.

-1 byte from each thanks to ceilingcat!

C (gcc), 44 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x(o+1,r+1):0;}

Try it online!

Uses recursion, note that to print strings containing the null byte one will have to manage the strings as arrays. (See the footer of the link for an example)

C (gcc), 50 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x(o+!!*o,r+!!*r):0;}

Try it online!

Slightly safer version (doesn't read past end of strings, requires enough memory to exist past them though - a la strcpy).

C (gcc), 61 bytes

x(b,o,r)char*b,*o,*r;{*o|*r?*b=*r^*o,x(b+1,o+!!*o,r+!!*r):0;}

Try it online!

As safe as any standard C function taking a buffer, at the cost of a few more bytes.

C (gcc), (削除) 44 (削除ここまで) 43 bytes

x(o,r)char*o,*r;{*o|*r&&x(o+1,r+1,*o^=*r);}

Try it online!

Uses recursion, note that to print strings containing the null byte one will have to manage the strings as arrays. (See the footer of the link for an example)

C (gcc), (削除) 50 (削除ここまで) 49 bytes

x(o,r)char*o,*r;{*o|*r&&x(o+!!*o,r+!!*r,*o^=*r);}

Try it online!

Slightly safer version (doesn't read past end of strings, requires enough memory to exist past them though - a la strcpy).

C (gcc), (削除) 61 (削除ここまで) 60 bytes

x(b,o,r)char*b,*o,*r;{*o|*r&&x(b+1,o+!!*o,r+!!*r,*b=*r^*o);}

Try it online!

As safe as any standard C function taking a buffer, at the cost of a few more bytes.

-1 byte from each thanks to ceilingcat!

some safer variants added.
Source Link
LambdaBeta
  • 2.8k
  • 13
  • 20

C (gcc), 44 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x(o+1,r+1):0;}

Try it online!

Uses recursion, note that to print strings containing the null byte one will have to manage the strings as arrays. (See the footer of the link for an example)

C (gcc) , 50 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x(o+!!*o,r+!!*r):0;}

Try it online!

Slightly safer version (doesn't read past end of strings, requires enough memory to exist past them though - a la strcpy).

C (gcc) , 61 bytes

x(b,o,r)char*b,*o,*r;{*o|*r?*b=*r^*o,x(b+1,o+!!*o,r+!!*r):0;}

Try it online!

As safe as any standard C function taking a buffer, at the cost of a few more bytes.

C (gcc), 44 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x(o+1,r+1):0;}

Try it online!

Uses recursion, note that to print strings containing the null byte one will have to manage the strings as arrays. (See the footer of the link for an example)

C (gcc), 44 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x(o+1,r+1):0;}

Try it online!

Uses recursion, note that to print strings containing the null byte one will have to manage the strings as arrays. (See the footer of the link for an example)

C (gcc) , 50 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x(o+!!*o,r+!!*r):0;}

Try it online!

Slightly safer version (doesn't read past end of strings, requires enough memory to exist past them though - a la strcpy).

C (gcc) , 61 bytes

x(b,o,r)char*b,*o,*r;{*o|*r?*b=*r^*o,x(b+1,o+!!*o,r+!!*r):0;}

Try it online!

As safe as any standard C function taking a buffer, at the cost of a few more bytes.

Source Link
LambdaBeta
  • 2.8k
  • 13
  • 20

C (gcc), 44 bytes

x(o,r)char*o,*r;{*o|*r?*o^=*r,x(o+1,r+1):0;}

Try it online!

Uses recursion, note that to print strings containing the null byte one will have to manage the strings as arrays. (See the footer of the link for an example)

AltStyle によって変換されたページ (->オリジナル) /