This preview shows page 1. Sign up to view the full content.
Unformatted text preview: scanf, strcpy, and random. They are available to every C program in the libc.a library. ANSI C also deﬁnes an extensive collection of ﬂoating point math functions such as sin, cos, and sqrt in the libm.a library. Consider the different approaches that compiler developers might use to provide these functions to users without the beneﬁt of static libraries. One approach would be to have the compiler recognize calls to the standard functions and to generate the appropriate code directly. Pascal, which provides a small set of standard functions, takes this approach, but it is not feasible for C because of the large number of standard functions deﬁned by the C standard. It would add signiﬁcant complexity to the compiler and would require a new compiler version each time a function was added, deleted, or modiﬁed. To application programmers, however, this approach would be quite convenient because the standard functions would always be available. Another approach would be to put all of the standard C functions in a single relocatable object module, say libc.o, that applic...
View Full Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
- Spring '10
- The American