ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Using Piecewise Linear Functions in Optimization: a Transport Example > Displaying a Solution

To display the solution, use the methods of IloEnv and IloCplex.

    env.out() << '' - Solution: '' << endl;
    for(i = 0; i < nbSupply; i++){
      env.out() << ''   '' << i << '': '';
      for(j = 0; j < nbDemand; j++){
        env.out() << cplex.getValue(x[i][j]) << ''\t'';
      }
      env.out() << endl;
    }
    env.out() << ''   Cost = '' << cplex.getObjValue() << endl;