title: How do I fix Access violation writing exception
body: <p>I have following bit of code </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  #include &lt;ctype.h&gt;
  char *convertire(char *sir)
  {
      char *sir2="";
      while (*sir)
      {
          *sir2 = toupper(*sir);
          sir++;
      }
      return (sir2);
  }
  void main(void)
  {
      char *sir = "Home is good";
      char *sir2 = convertire(sir);
      printf("Sirul obtinut este : %s\n", sir2);
      _getch();
  }
  </code></pre>
  
  <p>When I try to compile I get the following error </p>
  
  <pre><code>First-chance exception at 0x00E3141B in pointeri.exe: 0xC0000005: Access violation writing location 0x00E35858. If there is a handler for this exception, the program may be safely continued.
  </code></pre>
  
  <p>Can you please help me resolve this ?</p>