title: set copy array of float to multidimensional array
body: <p>I am trying to understand pointers in c/arduino, and its giving me problems :)</p>
  
  <p>I have a function that creates and returns a pointer to an array of floats:</p>
  
  <pre><code>float* CreateArray(int i) {
      float test[2];
      test[0] = float(i+1); 
      test[1] = float(i+2);
      return test;
  }
  </code></pre>
  
  <p>I have also defined a multidimensional array:</p>
  
  <pre><code>float data[2][2];
  </code></pre>
  
  <p>Before I do anything I expect data to look like this: (which it does)</p>
  
  <pre><code>0 0
  0 0
  </code></pre>
  
  <p>When I run the following code:</p>
  
  <pre><code>float* array = CreateArray(22);
  *data[1] = *array;
  </code></pre>
  
  <p>I expect data to look like this:</p>
  
  <pre><code>0  0
  23 24
  </code></pre>
  
  <p>But it looks like this:</p>
  
  <pre><code>0  0
  23 0
  </code></pre>
  
  <p>Somehow the information that the created array was a float[2] is lost, and when I try to cast it to float[2] I get:</p>
  
  <pre><code>ISO C++ forbids casting to an array type 'float [2]'
  </code></pre>