title: C++ Instances VS pointers VS references
body: <p>I've a program which creates many instances of my own Class. Then I operate them: read, change, pass them to some third party methods etc.</p>
  
  <p>There are three questions.</p>
  
  <ol>
  <li><p>Do I store an vector of instances or a vector of pointers? Why?</p></li>
  <li><p>If I <strong>do not</strong> want to change an instance do I pass to the function an instances or pointers to it? Why?</p></li>
  <li><p>If I <strong>do</strong> want to change an instance, do I pass a pointer or a reference? Why?</p></li>
  </ol>
  
  <p>Thanks in advance!</p>
  
  <p>Class example:      </p>
  
  <pre><code>class Player {
      public:
          static const char               width = 35;
          static const char               height = 5;
          static const char               speed = 15;
  
          int                             socketFD;
          float                           xMin;
          float                           xMax;
  
          char                            status;
          float                           x;
          float                           y;
          char                            direction;
  
                                          Player ( int );
          void                            Reset();
          void                            Move();
          void                            SetHost();
          void                            SetClient();
  
      private:
          void                            EscapeCheck();
  };
  </code></pre>