3 ms·
Can you explain the static functions thing? What’s the benefit of declaring all functions static if you’re compiling them as a single translation unit anyway?
by AdamH12113 3y ago
Can you explain the static functions thing? What’s the benefit of declaring all functions static if you’re compiling them as a single translation unit anyway?
- f1shy 3y agoStatic means only visible for that translation unit. So they are not global. Only global inside the file.
- lelanthran 3y agoYou don't get the linker complain of multiply defined symbols when your code is linked in as a library to some other project. If you're writing code that never gets reused, then it's fine, no need for static functions.