title: How to copy arrray to array using memcpy() in C
body: <p>I am trying copy an array <code>(temp)</code> from another array <code>a</code>.
  But I have it is not happening.</p>
  
  <p><code>Fig-1</code></p>
  
  <pre><code>int main()
  {
      typedef int arr_1[3];
      arr_1 arr[4];
      arr_1 *temp;
      arr_1 a[3] = {1, 2, 3};
      memset(&amp;temp, 0, sizeof(temp));
      memcpy(temp, a, sizeof(temp));
  }
  </code></pre>
  
  <p>But when I tried with a simple program like below,</p>
  
  <p><code>Fig-2</code></p>
  
  <pre><code> main()
      {
      int abc[3], def[3];
      def[3] = {1, 2, 3};
      memcpy(abc, def, sizeof(abc));
      }
  </code></pre>
  
  <p>This above code <code>(fig-2)</code> worked really fine for me.
  But <code>fig-1</code> is not working for me. Both are alomost same.
  But why the <code>fig-1</code> is not working??</p>