Quantcast
Viewing latest article 32
Browse Latest Browse All 67

Answer by Dennis for Tips for golfing in C

import if you have to

As noted in the very first answer, some compilers (notably, GCC and clang) let you get away with omitting #includes for standard library functions.

Even if you can't just remove the #include, there might be other ways to avoid it, but that's not always practical or particularly golfy.

In the remaining cases, you can use #import<header file> instead of #include<header file> to save a byte. This is a GNU extension and it is considered deprecated, but it works at least in gcc 4.8, gcc 5.1, and clang 3.7.


Viewing latest article 32
Browse Latest Browse All 67

Trending Articles