Chippys_mittens@lemmy.world to memes@lemmy.world · 8 hours agoFucklemmy.worldimagemessage-square50fedilinkarrow-up1635arrow-down17
arrow-up1628arrow-down1imageFucklemmy.worldChippys_mittens@lemmy.world to memes@lemmy.world · 8 hours agomessage-square50fedilink
minus-squareDrekaridill@lemmy.wtflinkfedilinkarrow-up14·3 hours agoI was a TA in a class that expected knowledge of C. A lot of students who had only ever used Python asked if I could ring them up to speed. One student even asked if he could write it in Python and then I could “just translate it over”
minus-squareDumhuvud@programming.devlinkfedilinkEnglisharrow-up2·29 minutes agoIt’s rather trivial to translate Python to C: $ cat << EOF > ./shitpost.c && gcc -O2 -o ./shitpost ./shitpost.c && ./shitpost #include <stdlib.h> int main(int argc, char** argv) { system("python3 -c \\"print(\\\\\\"Hello, World!\\\\\\")\\""); return 0; } EOF Hello, World! My C is a bit rusty though, sorry.
minus-squaredwemthy@lemmy.worldlinkfedilinkarrow-up8·2 hours agoJust add semi colons and brackets, right?
minus-squareSaharaMaleikuhm@feddit.orglinkfedilinkarrow-up3·1 hour agoJust put a bunch of asterisks everywhere.
I was a TA in a class that expected knowledge of C. A lot of students who had only ever used Python asked if I could ring them up to speed. One student even asked if he could write it in Python and then I could “just translate it over”
It’s rather trivial to translate Python to C:
$ cat << EOF > ./shitpost.c && gcc -O2 -o ./shitpost ./shitpost.c && ./shitpost #include <stdlib.h> int main(int argc, char** argv) { system("python3 -c \\"print(\\\\\\"Hello, World!\\\\\\")\\""); return 0; } EOF Hello, World!My C is a bit rusty though, sorry.
Just add semi colons and brackets, right?
Just put a bunch of asterisks everywhere.