Remilia Scarlet Posted October 26, 2003 Given that I haven't done classes in so long in C++, I was wondering: 1. How do I make, and pass to a function, an array of class objects? 2. If I were to make a vector of objects instead, how do I pass these to functions and then call the classes's member functions? Examples: (assume I have a class called class_queens)class_queens queens[8]; for(int i = 0; i < 8; i++) { queens[i].set_phone_number(5551212); if(is_safe(queens, i, 8) {...} } or vector <class_queens> queens[8]; for(int i = 0; i < 8; i++) { queens[i].set_phone_number(5551212); if(is_safe(queens, i, 8) {...} } Obviously, I'm not storing the phone numbers of queens, but just used as an example. If I use objects, it'd make this damned 8-queen problem alot easier to solve. I could solve it in about 15 minutes in VB. 0 Share this post Link to post