title: C++ passing char array to function
body: <p>I would rather just use a string, but we aren't supposed to as the teacher hates them and wants us to figure out ways to avoid them. So I looked into using a struct, but we aren't that far in the book and she hates it when I skip ahead. So I was thinking of doing this: </p>
  
  <pre><code>#include &lt;iomanip&gt;
  #include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  void myfunc(char&amp; );
  
  int main()
  {
      char myname[12];
      cout&lt;&lt;"enter  a name ";
      cin&gt;&gt;myname;
      cout&lt;&lt;"myname is "&lt;&lt;myname;
  
      cout&lt;&lt;"myname is " &lt;&lt; myfunc(myname);
  
      getchar();
      getchar();
      return 0;
  }
  
  void myfunc(char &amp;myname1)
  {
      myname1 = "Billy"
  }
  </code></pre>
  
  <p>But this doesn't work and I don't know why.</p>