source code of c/c++ functions

前端 未结 14 2222
抹茶落季
抹茶落季 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:20

    Most compilers provide source code for the library - however that source code is usually rather more complex and convoluted than you might expect.

    A good resource for this is P.J. Plauger's book, "The Standard C Library", which can be had pretty cheaply if you go for a used one. The code presented is not always straight-forward, but Plauger explains it quite well (and gives the reasons why it can't always be straight-forward and still follow the standard).

提交回复
热议问题