Zhang Jiuan’ Notes

贴一道面试题,看看你能得几分

很多时候可以通过一道简单的程序可以看得出对编程的理解。

下面贴一道c的面试题,请指出错误点并修改。如果让你重新设计

和实现,你会写成什么样子。

void strcpy(char *p1, char *p2)
{
    for (int i = 0; i <= strlen(p1); i++) {
        p1[i] = p2[i];
    }
}

答案过两天贴吧,不过也是本人个人认为的答案,不一定完美。

 

thx

张久安

If you enjoyed this post, make sure you subscribe to my RSS feed!

No Comments, Comment or Ping

Reply to “贴一道面试题,看看你能得几分”

You must be logged in to post a comment.

返回顶部