Curious about matrices and arrays.

I was reading about matrices and saw how similar they are to arrays in c++. I then opened a new project and tried adding two arrays together like you can with matrices and got the obligatory error 'cannot add two pointers'.
Out of curiosity only I was wondering whether you can add, multiply etc arrays together.
You have to loop through each element and perform the math one element at a time.
Alternatively you can create a C++ class say Matrix and then you overload the operators +, * etc. Then in your calling code, you can code as though the Matrix object can do add and multiply etc in an intuitive manner.
Right gotcha. No magic then...
Topic archived. No new replies allowed.