Where to find my system's implementation of standard C library functions?
for example, the strrev() function. i know that it's declared in string.h, and i wanna to figure out how it is implemented. so where could i the sourc开发者_如何学运维e code?
OS: Windows XP SP3
IDE: Pelles C 6.50 RC3If you just want to see the source to an implementation of the standard C library (albeit one that is in wide use), the source to glibc is available. You can clone the git repository:
git clone git://sourceware.org/git/glibc.git
You can also examine the source in a browser. Here's the string library, for instance.
glibc does not include strrev()
. However, if you Google for
strrev c
you'll get hits to various implementations. For example: http://www.cas.mcmaster.ca/~kahl/SE2S03/2006/C/strrev.c and ftp://ftp.ecs.vuw.ac.nz/pub/libs/libstrings/strrev.c.
It depends where your particular compiler puts it. Many compilers don't provide the library source code.
精彩评论