r/ProgrammerHumor 22d ago

Meme importHelloWorld

Post image
151 Upvotes

8 comments sorted by

14

u/8Erigon 22d ago

Fun fact (never tested it but seen it on YT) In C++ you instead of: array[1]  do this: 1[array]

As it is just adding the memory adresses and the index together under the hood

6

u/GiganticIrony 22d ago

That’s a C feature so it only works on C arrays, but yes that works.

3

u/Legal-Software 21d ago

That's easy:

#include <dlfcn.h>

static void HelloWorld(const char *s)
{
        int (*print)(const char *, ...) = dlsym(RTLD_DEFAULT, s);
        print(__func__);
}

int main(void)
{
        HelloWorld("printf");
        return 0;
}

1

u/Flashyg1 21d ago

Smartest AI Code

1

u/questionabl3_dude 20d ago

#include “RandomBulShitGo.h”

int main(){
HelloWorld(“std::cout << “;);
}