c++
   if (nrows < /* size of rows array */) {
       rows[nrows++] = br + bpr*sy; 
   } else {
       // Handle the error (e.g., log, throw an exception)
   } 
   