Array of structs with new[] doesn't seem to work if said struct have constructor : <p>For an assignment I have a struct with constructor defined and wish to create array of these using new[] operator. I can't understand why this doesn't work. The code is like so (pseudo code):</p>

<pre><code>struct Structname 
{
int x;
int y;
Structname(int a,int b)
{
x=a;
y=b;
}
}
</code></pre>

<p>Now trying to do:</p>

<pre><code>Structname *Array = new Structname[size]
</code></pre>

<p>Results in error "No function matching call Structname::Structname() on Structname[size]" (not exact citation). The error doesn't occur when there is no constructor in my struct just as if the compiler expects me to use the constructor in Structname* Array = new Structname[size]. I cannot delete the constructor because I need it in other parts of the code. Also I cannot use std::vector due to assignment rules.</p>
