title: C++ cplex value of variable in loop for
body: <p>I got a problem in my program. I know where but I don't know why.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;ilcplex/ilocplex.h&gt;
  ILOSTLBEGIN
  using namespace std;
  typedef IloArray&lt;IloNumArray&gt;    NumMatrix;
  typedef IloArray&lt;IloNumVarArray&gt; NumVarMatrix;
  
  int main() {
  IloEnv env; 
  IloInt i, j, k;
  IloModel model(env); 
  IloInt pro = 4; 
  IloInt empl = 5;
  
  IloNumArray e(env, project, 2, 2, 2, 3);
  IloNumArray pr(env, project, 1000, 2000, 500, 1500);
  
  IloNumVarArray p(env, project, 0, 1);
  NumVarMatrix x(env, project);
  
  for(k = 0; k &lt; pro; k++) {
      x[k] = IloNumVarArray(env, empl+1, 0, 1);
  }
  
  for(k = 0; k &lt; pro; k++) {     
      IloExpr sum_over_i(env);
      for(i = 0; i &lt; empl; i++)
          sum_over_i += x[i][k];
      model.add(sum_over_i &gt;= e[k] * p[k]);
      sum_over_i.end();
  }
  
  }
  </code></pre>
  
  <p>When pro and empl is same value or empl less than pro everything work. but if empl is more than pro it doesn't work anymore.</p>
  
  <p>Does anyone have an idea why empl can't be > than pro?</p>
  
  <p>Thanks</p>