//For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C

//Path of input excel file
StringPtr sampleInsertingDeletingRowsAndColumns = dirPath->StringAppend(new String("sampleInsertingDeletingRowsAndColumns.xlsx"));

//Path of output excel file
StringPtr outputInsertingDeletingRowsAndColumns = outPath->StringAppend(new String("outputInsertingDeletingRowsAndColumns.xlsx"));

//Read input excel file
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(sampleInsertingDeletingRowsAndColumns);

//Accessing the first worksheet in the Excel file
intrusive_ptr<IWorksheet> worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0);

//Inserting a row into the worksheet at 3rd position
worksheet->GetICells()->InsertRow(2);

//Save the Excel file.
workbook->Save(outputInsertingDeletingRowsAndColumns);