ILOG CPLEX 11.0 Getting Started > Tutorials > Concert Technology Tutorial for C++ Users > Building and Solving a Small LP Model in C++ > Modeling by Rows

The function populatebyrow creates the variables and adds them to the array x. Then the objective function and the constraints are created using expressions over the variables stored in x. The range constraints are also added to the array of constraints c. The objective and the constraints are added to the model.