How to write a better strlen function?

后端 未结 7 1911
Happy的楠姐
Happy的楠姐 2020-12-30 06:43

I am reading \"Write Great Code Volume 2\" and it shows the following strlen impelementation:

int myStrlen( char *s )
{
    char *start;
    start = s;
    w         


        
7条回答
  •  攒了一身酷
    2020-12-30 07:36

    Answering OP's question about where to find suggestions how to write code for performance, here's link to MIT OpenCourse on writing Optimized C Code (look for "Materials" link on the left of page).

提交回复
热议问题