-1

When I build C# applications I only reference external libraries, be they standard libraries as part of the framework or any other, but in C one includes them (copy and paste). Isn't it very inefficient and redundant to include the standard libraries of C inside the executables of all C programs instead of just having them referenced at runtime? If I have 100 C executables, doesn't that leave me with 100 copies of the included libraries in addition to my own code?

HelloWorld
  • 2,375
  • 5
  • 22
  • 21

1 Answers1

0

The libraries are actually referenced at runtime.

The header files that you include in your C code only describe what functions are available from a given library, so that your C code won't throw errors when you try to use them (or actually throw errors when you use them wrongly, e.g. with a wrong number of arguments). The libraries themselves are most often contained in separate files (although sometimes it can be advantages to include the libraries in the executables themselves, which is also possible).

Frxstrem
  • 38,761
  • 9
  • 79
  • 119