Just for fun I decided to complete some codejam challenges in D. At some point I wanted to add structs to an array but I got a compiler error. What am I doing wrong?<div><br></div><div>code:</div><div><div>struct test{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>int x;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>int y;</div><div>}</div><div>void main(){</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>test[] why;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>why~={3,5};</div><div>}<span class="Apple-tab-span" style="white-space:pre"> </span></div></div><div><br></div><div>error:</div><div><div>wait.d(7): found '}' when expecting ';' following statement</div>
<div>wait.d(8): found 'EOF' when expecting ';' following statement</div><div>wait.d(8): found 'EOF' when expecting '}' following compound statement</div></div><div><br></div><div>Is there any reason a why this wouldn't work?</div>