C and C++ by themselves can't actually do anything, they need the libraries to work. So how were the libraries created? Assembly language?
The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. Starting from the original ANSI C standard, it was developed at the same time as the C library POSIX specification, which is a superset of it.
It was based on CPL (Combined Programming Language), which had been first condensed into the B programming language—a stripped-down computer programming language—created in 1969–70 by Ken Thompson, an American computer scientist and a colleague of Ritchie.
The function is defined in the math. h header file.
C and C++ libraries are almost universally written in C and C++, as are C and C++ compilers. In fact, many compilers are even used to compile themselves!
How is this possible? Well, obviously the first C compiler couldn't have been initially developed in C. However, once a C compiler exists, then it can be used to compile another compiler. And as a compiler is being developed, so is the source code. It's possible to develop both side-by-side. Since most compilers are improvements on their predecessors, they are often used to compile better versions of themselves!
However, with respect to the library, that's easy: C can actually do something. While some lower-level routines may be written in assembler, the vast majority can be written in C or C++.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With