title: How to terminate a character pointer at a certain location in c?
body: <p>I'm trying to terminate a character pointer in c, at a specific location by setting the null terminator to it.</p>
  
  <p>for examples if I have a char pointer</p>
  
  <pre><code> char *hi="hello";
  </code></pre>
  
  <p>I want it to be <code>"hell"</code> by setting the <code>o</code> to null.</p>
  
  <p>I have tried doing this with strcpy with something like </p>
  
  <pre><code>strcpy(hi+4, "\0");
  </code></pre>
  
  <p>But it is not working.</p>