anew4.c
来自「this is a gcc file, you can download it 」· C语言 代码 · 共 38 行
C
38 行
// { dg-do run }// PR 11228: array operator new, with zero-initialization and a variable sized array.// Regression test for PR // Author: Matt Austern <austern@apple.com>struct B{ B(); int n;};B::B(){ n = 137;}struct D : public B{ double x;};D* allocate(int n){ return new D[n]();}int main(){ const int n = 17; D* p = allocate(n); for (int i = 0; i < n; ++i) if (p[i].n != 137 || p[i].x != 0) return 1; return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?