title: passing a pointer to a char array in c
body: <p>I wrote a small test program to see how I can pass a pointer to a char array to a function.  This is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int scopy(char *org ){
      printf("the value of org is %s" , org);
      printf("\n");
  }
  
  int main(void)
  {
      char original[11];
      strcpy(original , "helloworld");
  
      scopy(original);
  
      printf("the value of original now is %s" , original);
  
      return 0;
  }
  </code></pre>
  
  <p>My knowledge of pointers tells me that org is a pointer that is passed the memory address of original[0] , when I execute this program I observe a few things that has confused me and has caused me to doubt the facts I have learnt about pointers.</p>
  
  <p>when I print org I get the complete word back . but according to the logic if pointers isnt this supposed to print out the memory address;</p>
  
  <p>when I try printing out out[1] , out[2] , codepad tells me that the process has ended abnormally</p>
  
  <p>My  basic doubt in this question is what exactly is org doing , I understand it is a char pointer pointing to a memory address (which??) . Any help would be appreciated . I am very new to c programming .</p>
  
  <p>Also when I try a while loop like</p>
  
  <pre><code>while(out[i] !='\0')
  printf("%s",out[i]);
  </code></pre>
  
  <p>it does not terminate at the '\0' . the strcpy documentation states that the '\0' is copied to the char array. </p>