title: While merging two arrays, if array size is taken as input from user then its fine but if sizeof() operator is used, then its a segmentation fault?
body: <p><em><strong>//cin&gt;&gt;m&gt;&gt;n; //this makes the programme work</strong></em></p>
  <p>I am not getting why is this happening. <code>sizeof()</code> will allot the same value to <code>m</code> and <code>n</code> as <code>(cin)</code> would, then why is there a fault..?</p>
  <pre><code>    #include&lt;iostream&gt;
      using namespace std;
  
      int * merge(int A[], int B[], int m, int n)
      {
          for(int i=m,j=0; i&lt;(m+n);i++, j++)
          A[i]=B[j];
  
      }
      int main()
      {
          int A[]={1,2,3,4,5,6,7,8} , B[]={4,5,6},m,n;
          m=sizeof(A)/sizeof(int);
          n=sizeof(B)/sizeof(int);  
          merge(A,B,m,n);
          for(int i=0;i&lt;(m+n);i++)
          cout&lt;&lt;A[i]&lt;&lt;&quot; &quot;;
          return 0;
      }
  </code></pre>