3 ms·
Don't include the standard headers and just put it the definition for the symbols you're using. With std::cout you might end up pulling your hair out to find ev
by nsguy 2y ago
Don't include the standard headers and just put it the definition for the symbols you're using. With std::cout you might end up pulling your hair out to find everything but I can't imagine it'd be more than a few dozen lines... Not gonna try ;)
With C you just need a definition for printf instead of including stdio. In the old days you'd get by without even defining it at all.
- flohofwoe 2y ago> In the old days you'd get by without even defining it at all. GCC and Clang have a `__builtin_printf()` instead, quite useful for adhoc printf-debugging without having to include stdio.h. Under the hood it just resolves to a regular printf() or puts() stdlib call though.
- qznc 2y agoIn C, you can get away with just this (no includes or definitions): void main() { puts("Hello, World!"); } You get a warning, but it is fine.