title: c++ copy array with copy constructor
body: <pre><code>class Array{
      int size;
      int *array;
      public:
          Array(const int *);
          Array(const Array &amp;);
          void Print();
          ~Array();   
  
  };
  </code></pre>
  
  <p>Here my class</p>
  
  <pre><code>cout&lt;&lt;"I am constructor"&lt;&lt;endl;
          size=sizeof(data_in);
  
          array=new int[size+1];
  
          for(int i=0;i&lt;size+1;i++){
              array[i]=data_in[i];
          }
  </code></pre>
  
  <p>here my constructor</p>
  
  <pre><code>cout&lt;&lt;"I am copy constructor"&lt;&lt;endl;
          size=sizeof(object_in);
          array=new int[size+1];
  
          for(int i=0;i&lt;size+1;i++){
              array[i]=object_in.array[i];
          }
  </code></pre>
  
  <p>here my copy constructor            </p>
  
  <pre><code>int main()
      int *a;
      a=new int[4];
      for(int i=0;i&lt;5;i++){
  
          a[i]=i;
          cout&lt;&lt;a[i]&lt;&lt;endl;
          }
  
      Array array1(a);//Constructor invoked
      array1.Print();
  
      Array another=array1;//copy constructor invoked
      another.Print();
  </code></pre>
  
  <p>here is my main function.
       I want to my array copy to another array with the copy constructor.But this code isn't working properly.What can ı do simply?</p>