How to change one row in a matrix using a loop?

Hello. I have the matrix below (3x3)which contains 9 names. How can I change one row in this matrix using a loop and set all names (of that row) to Pete? Thanks for any help.

string **firstArray = new string*[3];
for (int i = 0; i < 3; i++)
{ firstArray[i] = new string[3];}
Call function ChangeRow() showed as follows, giving row as the row number (0, 1, or 2) that you want to change
1
2
3
4
5
void ChangeRow(string ** pStr, unsigned int row) {
  for (unsigned int j=0; j<3; j++) {
    pStr[row][j] = "Pete";
  }
}
Topic archived. No new replies allowed.