title: C array pointer in function
body: <p>I wrote this function:</p>
  <pre><code>int einmaleins(int zahl, int *arr){
  int e;
  for(int i = 1; i&lt;11; i++){
      e = zahl*i;
      arr[i-1]=e;
  }
  
  return 0;
  }
  
  int main(){
  int arr[10] = {0};
  einmaleins(2, &amp;arr[10]);
  
  return 0;
  }
  </code></pre>
  <p>The Problem is the Pointer Array but when I start the program I got the following message: *** stack smashing detected ***: terminated</p>
  <p>I really don't know what to do.</p>