IBM ILOG Solver User's Manual > Local Search > Combining Complete and Local Search: Locating Warehouses > Solve > Displaying information about a solution

We define the function DisplaySolution to display the solution:

// Function to display the solution

void DisplaySolution(IloSolver solver,
                     const char *phrase,
                     IloIntVar cost,
                     IloIntVarArray offer) {
  solver.out() << endl << phrase << endl
               << "[" << solver.getValue(cost) << "]" << endl
               << solver.getIntVarArray(offer) << endl;
}