Is there anyway to pass an array of classes to a function in c++???
Is there anyway to pass an array of classes to a function in c++???
I assume you mean an array of one particular class. If so, then its the same way you pass any other array:
Code:void myfunction(myclass []);
All the solution the others have presented pertain to class objects, not classes. You cannot pass class in C++, only class objects.
You should implement the solutions above.
Kuphryn
Last edited by kuphryn; 11-14-2002 at 03:02 AM.
Or far better - std::vector passed by reference