title: incompatible types when assigning to type 'array[256]' from type 'array *'
body: <p>I'm quite new to C so in order to learn it I was trying to create a program which outputs a dragon curve.
  Here's what I got so far:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #define ebene 5
  
  char str_n[ebene-1];
  char tmp[256]; // ="1"; // 1=R, 0=L
  char text[256];
  
  int a_index=0;
  
  
  char switch_middle(char iarray[256]) {
      int num=((2^a_index-1)-1)/2+1; // Nummer der Zahlen pro ebene |-1|/2|+1 -&gt; Index des mittleren Buchstaben
      if(num&gt;=0) {
          iarray[num]='0';
      } else {
          iarray[0]='\0';
      }
  }
  
  int main() {
      printf("Hauptschleife erreicht");
  
      while(a_index&lt;ebene) {
          //snprintf(text, sizeof text, "%s1%s", tmp, switch_middle(tmp));
          strcpy(text, tmp);
          strcpy(text, "1");
          strcpy(text, switch_middle(tmp));   // Error occures here!
  
          //str_n[a_index]=text;
          for(long i=sizeof(tmp)/sizeof(tmp[0]); i--; ) {
                  tmp[i]=text[i];
              }
          printf("Ebene: %d\n", a_index);
          //printf("  Wert: %s", str_n[a_index]);
          printf("    Wert: %d\n", text);
  
          a_index++; // für Mathefunktionen
      }
  }
  </code></pre>
  
  <p>Trying to compile this gives me a bunch of warnings and one error; that one I mentioned in the title of this question (incompatible types when assigning to type 'char[256]' from type 'char *').
  So, yeah. Any help would be appreciated (:</p>
  
  <p>*Edit: Alright, the comments below fixed most of the problems; Now there is only one warning left and that is "passing argument 2 of 'strcopy' makes pointer from integer without a cast' and "expected 'const cgar * restrict' but argument is of type 'char'" as a note for the included string.h. When I try to run that program it gives me a memory access error. I marked the lines in the code above.</p>
  
  <p>*Edit²: Fixed. Thanks to everyone below (:</p>