title: C++ reading and writing problems in using std::vector with classes
body: <p>I have this class in a hpp file:</p>
  <pre><code>class info
  {
      public:
          float lux[100];
          float pwm[100];
          float time[100];
          float ref_lux;
          int counter_samples_stream;
  };
  </code></pre>
  <p>In the cpp file that contains this header, I create a vector of this class and because I put it in the beginning of the cpp file it is a global variable. This is the code I use to create it:</p>
  <pre><code>std::vector &lt;info*&gt; vect_node[3]; //creates 3 instances of class info in a vector
  </code></pre>
  <p>Inside the function(called abc) we are changing and initializing the vector's data by doing per example this:<code> vect_node[1].lux[0] = 25;</code> .</p>
  <p>We are also trying to access the vector's data in another function(called zys) but when trying to access it the program crashes and returns core dumped.</p>
  <p>Neither function abc or zys pass the vect_node in its arguments. The doubt is how can I write in <code>vec_node</code>in a function in a way it changes its values permanently(and not only in the function) and read from this vector now updated in another function(syz).</p>