title: how to get a part of a char array in c
body: <p>I am new in C and I have the following simple code. I know that with the strncpy I can copy characters from string.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main ()
  {
    char str1[]= "To be or not to be";
    char str2[40];
  
    strncpy ( str2, str1, 5 );
    str2[5] = '\0';   /* null character manually added */
    puts (str2);
  
    return 0;
  }  
  </code></pre>
  
  <p>The output of this code is </p>
  
  <pre><code>To be
  </code></pre>
  
  <p>If I want the result to be ´or not to´ how can I read these characters? From 7-15 in this case?</p>