source code of c/c++ functions

前端 未结 14 2177
抹茶落季
抹茶落季 2020-11-28 04:33

I wanted to have a look at the implementation of different C/C++ functions (like strcpy, stcmp, strstr). This will help me in knowing good coding practices in c/c++. Could y

相关标签:
14条回答
  • 2020-11-28 05:21

    In general, I find the BSD libc much easier to read than the GNU one. There are less "gcc-isms", the core is much clearer in intent, etc... For example, the BSD code for malloc is quite readable compared to glibc

    0 讨论(0)
  • 2020-11-28 05:24

    You could also have a look at the OpenBSD source tree. Specifically, you want the string subdirectory of libc.

    0 讨论(0)
  • 2020-11-28 05:25

    If you use Visual Studio Professional or Team, you should be able to find the source here:

    C:\Program Files\Microsoft Visual Studio 9.0\VC\crt\src

    0 讨论(0)
  • 2020-11-28 05:28

    "The Standarc C Library" is a specification. You want the sources for an implementation of the specification. Your C compiler may or not provide such sources - one that does is GCC.

    0 讨论(0)
  • 2020-11-28 05:33

    Here's the general strXXX C functions in NetBSD : http://cvsweb.netbsd.org/bsdweb.cgi/src/common/lib/libc/string/

    Here's the NetBSD strXXX implementation for i386 processors http://cvsweb.netbsd.org/bsdweb.cgi/src/common/lib/libc/arch/i386/string/

    0 讨论(0)
  • 2020-11-28 05:34

    standard c library

    0 讨论(0)
提交回复
热议问题