Question

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 source code?

OS: Windows XP SP3
IDE: Pelles C 6.50 RC3

Was it helpful?

Solution

If 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.

OTHER TIPS

It depends where your particular compiler puts it. Many compilers don't provide the library source code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top