title: c++ Access violation writing location 0x00000000
body: <p>I have the following code:
  In Client.cpp there is the constructor that is doing memory allocation for the array "conturi" of type ContBancar.</p>
  
  <pre><code>Client::Client(string nume, string prenume, string adresa)
  {
      this-&gt;nume = nume;
      this-&gt;prenume = prenume;
      this-&gt;adresa = adresa;
      nrCont = 0;
      ContBancar** conturi = new ContBancar*[50]; 
  }
  </code></pre>
  
  <p>Then there is a method that is adding a account in the "conturi" array:</p>
  
  <pre><code>void Client::adaugaCont(ContBancar* contNou)
  {
      conturi[nrCont++] = contNou;
  }
  </code></pre>
  
  <p>This is my code in Main.cpp:</p>
  
  <pre><code>ContBancar ron1 ("1.r", 0, Banca::RON);
  Client ioana ("Pop", "Ioana", "Str Dorobantilor 3/4");
  ioana.adaugaCont(&amp;ron1);
  </code></pre>
  
  <p>But it gives me the access violation error at runtime, like the array 'conturi' has no memory allocated. I don't understand why, because the memory should be allocated in the constructor.</p>
  
  <p>Could anyone help me with this? </p>