How to allocate memory space without using malloc or new operator?

后端 未结 4 1431
礼貌的吻别
礼貌的吻别 2020-12-16 23:31

When my friend had his interview yesterday, he was asked a question: Implement a function that allocates memory space without using the *alloc or new operator, and the func

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-17 00:11

    You can do it via a system call such as sbrk(), rather than using a C library function or a C++ language feature. There is absolutely no reason to do this, however, so this is a very crappy question.

提交回复
热议问题