New, delete, malloc, free
new
and delete
are said to be preprocessors while malloc
and free
are functions. 开发者_开发百科What is meant by new
and delete
being preprocessors?
new and delete are C++ operators (like +, (), etc.) whereas malloc and free are (C) functions. Some operators (including new and delete) can be overloaded.
精彩评论