MSDN上介绍的new这个操作符的疑问

x254128542 2009-04-07 03:18:46
MSDN上的原话
If the request is for zero bytes of storage, operator new returns a pointer to a distinct object (that is, repeated calls to operator new return different pointers)
下面的中文部分是我对这上面的这段英文的翻译,意思应该时没翻译错

如果请求是零字节的存储空间,new操作符返回一个指向独特对象的指针(换句话说,重复调用new操作符会返回不同的指针)

这也是MSDN上的另外的一段原话,意思和上面的差不多
All but the leftmost array dimensions must be constant expressions that evaluate to positive values; the leftmost array dimension can be any expression that evaluates to a positive value. When allocating an array using the new operator, the first dimension can be zero — the new operator returns a unique pointer.

那这个特别对象是个什么对象,有多大的字节?还是就是零字节?是返回NULL了?
...全文
79 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
x254128542 2009-04-07
  • 打赏
  • 举报
回复
自己顶下 哎 没分 要又分得多放点分分

65,210

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧