Thats no real "OOP": dont make class members argument in functions of the object :doh:
and rewrite the call
a.spiraltraversal();
the implementation should look like this
void matrix::spiraltraversal()
{
int rs=0,cs=0;
int re=row-1,ce=col-1;
while(rs<=re && cs<=ce)
{
int i=rs,j=cs;
for(j=cs;j<=ce;j++)
printf(" %u ",mat[i][j]);
for(j=rs+1,j--;i<=re;i++)
printf(" %u ",mat[i][j]);
for(j=ce-1,i--;j>=cs;j--)
printf(" %u ",mat[i][j]);
for(i=re-1,j++;i>=rs+1;i--);
printf(" %u ",mat[i][j]);
rs++; cs++; re--; ce--;
}
}
or similar ;-)