How to reverse each rows of the matrix?

i am able to get transpose of the matrix but how to reverse each row ???

take 2 pointer
one pointing to the first position other to the last

for each row of matrix do :
while ( i <= j ) {
swap(row[i], row[j]);
i++ , j-- ;
}