- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
Also, do y’all call main() in the if block or do you just put the code you want to run in the if block?
Also, do y’all call main() in the if block or do you just put the code you want to run in the if block?
I haven’t done much low level stuff, but I think the ‘main’ function is something the compiler uses to establish an entry point for the compiled binary. The name ‘main’ would not exist in the compiled binary at all, but the function itself would still exist. Executable formats aren’t all the same, so they’ll have different ways of determining where this entry point function is expected to be. You can ‘run’ a binary library file by invoking a function contained therein, which is how DLL files work.