C++ newbie question: classes and objects instantiated from them?

Annettest

New member
Joined
Mar 17, 2010
Messages
1
Reaction score
0
Points
1
Hi everyone:

I am a newbie with what is probably a simple C++ question.

I have created a class to make matrices/grids. I have also created functions to calculate values for the matrices. Right now, the functions are inside the matrix creation class. But I would like to move them so that the matrix class is purely for making matrices.

My question is, can I move them to a separate class (e.g., "matrix initialization" class)? Where I'm confused is, I have to instantiate the matrix class to create a matrix. So if I have my functions in a separate class, how can I attach/link them with the matrix object instantiated from the matrix class? If anyone knows how to get functions that belong to one class to act on objects instantiated from another class, I would very much appreciate help.

Thank you!
 
Back
Top