0

I have a matrix class which there are matrix objects. I want to call .value(int,int) directly on the matrix objects and set the internal 2d vector to the value on the right side of the equal sign.

Here is what I want to do:

new_matrix.value(row,col) = 0;

Here is what I've tried:

int &Matrix::value(int row, int col)
{
    return this->mat[row][col];
}

Where mat is the internal 2d vector data.

Edited by diafol: fixed formatting

2
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by SpS
0

It should work in both dev and VC...anyworks from next time give your complete code

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.