   Storing objects in lists
  What would be the best way to store an object in a list. Or is this even possible. What i mean is thisclass ball {//Definitions}ball ball1;//Can i do this ????????????something(int) class_array[4];class_array[1] = ball1; 
  There are all kinds of ways to store object references in lists.typedef struct ObjectList{void *object;ObjetList *nextObject;}ObjectList;ObjectList masterList;masterList.object = &myObject  Orstruct { int numObjects; SomeObject list[];}ObjectList  Cheers,Will;quote:Original post by Squirell  What would be the best way to store an object in a list.List or array? Think carefully before you answer. If the list will not change frequently, but you may access random elements, go for an array (or, better yet, std::vector if you''re using C++). If the list will feature frequent insertions and removals, go for a linked list (or, in similar tone, std::list). If you need something kinda half-way, use a std::deque.#include <vector> class Ball{  // blah}; std::vector<Ball> balls;  // replace vector with list or deque  Check your compiler documentation (or grep the web) for more information on using these standard constructs. ;  struct Boll {// bla bla bla};Boll ball1[antal]; 