View Single Post
Old 02-06-2007, 10:14 AM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
redhead is on a distinguished road
Your class needs an assignment operator ie = it can be accomplished like so:
Code:
class Avion{
  private: 
    std::string name;
    int number;
    std::vector <double> some_vector;
...
  public:
    Avion operator=(Avion a){
      name = a.name;
      number = a.number;
      some_vector = a.some_vector;
      return *this;
    };
...
}
Or however it will fit to reassign every member from your class to the current class instance..
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote