4

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

Lion
  • 965
  • 10
  • 21

2 Answers2

6

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.

Brian Clapper
  • 25,705
  • 7
  • 65
  • 65
1

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

Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466