I am working on a project in C, in which I am thinking to cut short stdio.h
header file and only keep the code which I need.
How shall I do this? Plus I would like to know whether cutting it short will make any difference to the speed?
I am working on a project in C, in which I am thinking to cut short stdio.h
header file and only keep the code which I need.
How shall I do this? Plus I would like to know whether cutting it short will make any difference to the speed?
Header files are interface files. They (usually) do not contain implementation code which would bloat your application. They are like a table of contents for the compiler into library files named such as crt.o
or libc.so
.
If you want, you can try forward-declaring standard functions by yourself, for example:
extern int printf( const char *, ... );
This practice is frowned upon and may not be supported very well. Note that such functions may be defined in standard headers as macros (as well as by the standard library binary file as extern
symbols), so there may be some difference in performance or executable size, compared to the usual #include
.