title: get substring in c
body: <p>I already have a function to get substring of a string</p>
  
  <pre><code>void subString(char* buffer, char* str, int start, int length)
  {
      int i, x = 0;
      int end=start+length;
      for(i = start ; i &lt;= end; i++)
          buffer[x++] = str[i];
      buffer[x] = '\0';
  
      //return temp;
  }
  </code></pre>
  
  <p>new string is stored in buffer</p>
  
  <p>but I prefer the function likes</p>
  
  <pre><code>char * subString(char* str, int start, int length)
  {
  
      //.......
  
  }
  </code></pre>
  
  <p>it will automatically returns the string pointer that has been alloced memory.</p>
  
  <p>Welcome any comment</p>