int sum = 0, i;
for(i = 0; i < 3; ++i) //Iterate through the horizontal elements of row 0.
{
sum = sum + m[0][i]; //Add this horizontal to the sum.
}
std::cout << sum; //Print the sum
To sum a vertical of m[][]:
1 2 3 4 5 6 7
int sum = 0, i;
for(i = 0; i < 5; ++i)//Iterate through verticals of column 0.
{
sum = sum + m[i][0]; //This time we add the verticals.
}
std::cout << sum;
To access a specific element:
1 2 3
//Remember that index starts at 0.
std::cout << m[2][1]; //Print element from column 3, row 2.