Bug 439 – Cannot use an array as new[] size argument.

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2006-10-17T05:06:00Z
Last change time
2014-02-15T13:21:43Z
Assigned to
bugzilla
Creator
godaves

Comments

Comment #0 by godaves — 2006-10-17T05:06:50Z
const size_t[] arr = [ 1,2,3 ]; void main() { int[] ar2, ar3; ar2 = new int[arr[2]]; // "need size of rightmost array, not type arr[2]" ar2 = new int[](arr[2]); // Ok size_t i = arr[2]; ar2 = new int[i]; // Ok }
Comment #1 by benoit — 2006-10-17T05:28:16Z
*** This bug has been marked as a duplicate of 411 ***