title: Is it possible to create an array of IloModel objects in C++?
body: <p>I've been unsuccessfully trying to create an array of IloModel object. Is there an easy way to do it ?</p>
  <p>This is what I've tried so far:</p>
  <pre><code>IloModel* models = new(env) IloModel[S];
  </code></pre>
  <p>The code compiles but whenever I try to add constraints to each one of the models, the following error message is displayed:</p>
  <p>Error:trying to add to an empty handle IloModel</p>
  <p>I've removed the argumento from the new operator and added the following lines to code I'm wrinting:</p>
  <pre><code>    cout &lt;&lt; &quot;0&quot; &lt;&lt; endl;
      for(int i=0; i &lt; S; S++)
          models[i] = IloModel(env);
  </code></pre>
  <p>But now the computer freezes when I run the code.</p>