Skip to main content

Posts

Showing posts with the label shared

C Traps & Pitfalls Book PDF Online by Andrew Koenig

C Traps & Pitfalls Book PDF Online by Andrew Koenig C Traps and Pitfalls is a slim computer programming book by former AT&T researcher and programmer Andrew Koenig, its first edition still in print in 2005, which outlines the many ways in which beginners and even sometimes quite experienced C programmers can write poor, malfunctioning and dangerous source code. It evolved from an earlier technical report published internally at Bell Labs, but is now available online in pdf form. <br> Happy coding.

Difference Between Static And Shared Libraries ?

Libraries are collection of precompiled functions which have been written to be reusable. Libraries in Linux are classified into two types: 1) Static Libraries :- The collection of object files kept together. When a program needs a function, that is stored in static library, it includes the header file that declares the function. The compiler combines the program code and linker links the library into an execuatble code. Static Libraries are also called as archives that ends with .a extension. e.g. /usr/lib/libc.a is a standard C library. Disadvantage of Static Libraries:- In the static libraries the function code is included in the executable. So when we run many applications that use the same function code, we end up with many copies of same functions in memory. 2) Shared Libraries :- When a program uses a function in a shared library, then that code does not get included in the execuatable. Instead it references to shared code that will be made available...