title: Atmel Studio: Returning a register which contains an array
body: <p>I am coding a project for an Arduino in Atmel Studio.
  In my code, I have two functions that look like the following:</p>
  
  <pre><code>unsigned char* USART_Receive(void){
      while(!(UCSR0A &amp; (1&lt;&lt;RXC0)) );
      return UDR0;
  }
  
  void Transmit(){
          unsigned char *a = USART_Receive();
  
          unsigned char pckaffe[4] = { 0x0C, 0x0A, 0x0F, 0x0E };
          unsigned char pcpersienner[4] = { 0x0B, 0x0B, 0x0B, 0x0B }; 
  
          if(a == pckaffe &amp;&amp; zeroCrossCounter() == 1){
              sendBurst();
          }
  }
  </code></pre>
  
  <p>If everything works right, the <code>UDR0</code> register should contain an array with 4 indexes (<code>array[4]</code>), therefore to return the array in the register, I used pointers. However, I get the following error at <code>return UDR0</code>: </p>
  
  <p><code>Error      invalid conversion from 'uint8_t {aka unsigned char}' to 'unsigned char*' [-fpermissive]</code></p>
  
  <h2>EDIT:</h2>
  
  <p>Adam Stepniak:</p>
  
  <pre><code>uint8_t varrr = 0;
  
  unsigned char* USART_Receive(void){
      while(!(UCSR0A &amp; (1&lt;&lt;RXC0)) );
      varrr = UDR0;
      return &amp;varrr;
  }
  </code></pre>