C++ 包含 malloc 声明的头文件的名称是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7292224/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the name of the header file that contains the declaration of malloc?
提问by Peter
What is the name of the header file that contains the declaration of the malloc()
function in C and C++?
包含malloc()
C 和 C++ 中函数声明的头文件的名称是什么?
回答by Mario
It's in stdlib.h
(C) and cstdlib
(C++).
它在stdlib.h
(C) 和cstdlib
(C++) 中。
In general, for such questions, just try to look on google: "c++ function". Most often the first hit will point to cplusplus.com for me containing a complete reference to the standard stuff.
一般来说,对于此类问题,只需尝试在google上查看:“c++ function”。大多数情况下,第一次点击会指向 cplusplus.com,其中包含对标准内容的完整参考。