Björn Tantau to Programmer Humor@programming.dev • 1 month agoPretty straight forwardswg-empire.deimagemessage-square46fedilinkarrow-up11arrow-down10file-text
arrow-up11arrow-down1imagePretty straight forwardswg-empire.deBjörn Tantau to Programmer Humor@programming.dev • 1 month agomessage-square46fedilinkfile-text
minus-square@ultrafastsloth@lemmy.worldlinkfedilink0•1 month agoI decided to throw my PC in the composter and become a gardener
minus-square@smeg@feddit.uklinkfedilinkEnglish0•1 month agoThat was actually the first line of C I’ve ever written so there’s no way I’m guessing the right number of escapes, but I guess I’d cheat by finding the value of each char and printing those one at a time.
minus-square@Beanie@programming.devlinkfedilink0•1 month agomy best guess: system("bash -c 'echo \\\"¯\\\\_(ツ)_/¯\\\"'"); which will get parsed as: bash -c 'echo \"¯\\_(ツ)_/¯\"' which will run: echo "¯\_(ツ)_/¯" and since echo just prints whatever was given to it, it’ll print "¯\_(ツ)_/¯" with the quotes
Now print “¯\_(ツ)_/¯” with the quotes
I decided to throw my PC in the composter and become a gardener
That was actually the first line of C I’ve ever written so there’s no way I’m guessing the right number of escapes, but I guess I’d cheat by finding the value of each char and printing those one at a time.
my best guess:
system("bash -c 'echo \\\"¯\\\\_(ツ)_/¯\\\"'");
which will get parsed as:
bash -c 'echo \"¯\\_(ツ)_/¯\"'
which will run:
echo "¯\_(ツ)_/¯"
and since
echo
just prints whatever was given to it, it’ll print"¯\_(ツ)_/¯"
with the quotes