title: Passing char pointer in C
body: <p>Okay so I am trying to pass a char pointer to another function. I can do this with an array of a char but cannot do with a char pointer. Problem is I don't know the size of it so I cannot declare anything about the size within the <code>main()</code> function.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void ptrch ( char * point) {
      point = "asd";
  }
  
  int main() {
      char * point;
      ptrch(point);
      printf("%s\n", point);
      return 0;
  }
  </code></pre>
  
  <p>This does not work however, these two works:</p>
  
  <p>1)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      char * point;
      point = "asd";
      printf("%s\n", point);
      return 0;
  }
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  void ptrch ( char * point) {
      strcpy(point, "asd");
  }
  
  int main() {
      char point[10];
      ptrch(point);
      printf("%s\n", point);
      return 0;
  }
  </code></pre>
  
  <p>So I am trying to understand the reason and a possible solution for my problem</p>