[linux_interest_group] 一道有趣的题目

  • From: figo zhang <figo1802@xxxxxxxxx>
  • To: linux_interest_group@xxxxxxxxxxxxx
  • Date: Fri, 6 Aug 2010 16:26:32 +0800

忽悠想起一道N年前去xx
interview的是被考的一个题目,要求当场在白板上写出来,当时虽然写了,感觉不太好,后来回去的路上在地铁上想出来比较好的方法,日!
拿出来给大家分享一下。

请用malloc()/free()重新写一对分配函数,要求分配的内存地址以n个字节对齐,比如n是32.


那位想到了,回复一下吧

Other related posts: