Hi to all ,
Ive written a program in c++ using structures not classes.
Its basically a program that compares and performs diverse operations between 2 or more matrix's.
Since my program is working I decided to unleash the full power of c++ and use a matrix class.
As i gathered objects can be created and passed to functions etc.
So i created object A and object B to be two matrix's of my matrix class.
My problems are the following:
1, I obviously need to compare and operate between the two matrix objects but unfortunately i cannot seem to be able to do that using my class methods. eg. i have a method to add matrix A to matrix B but I can only call the method with one object and i dont even know if its possible to call the method with both.
2. I tried taking my method out of the Matrix class and declaring it as a function but my compiler tells me that once out of the 'main' function it doesnt know what objects A and B are anymore. So I wonder if I need to include the following in each function I use:
<code>
Matrix A;
Matrix B;
</code>
Not that i think it really matters for such basic programming but Im using Borland c++ 5.02.
As you can see I would just like some advice on how to use classes and their objects.
Any help is appreciated thanks



LinkBack URL
About LinkBacks



