title: How to cut part of a string in c?
body: <p>I'm trying to figure out how to cut part of a string in C. For example you have this character string "The dog died because a car hit him while it was crossing the road" how would a function go making the sentence "a car hit him while crossing the road" or "a car hit him"</p>
  
  <p>How do you go about this with C's library (or/and) a custom function?</p>
  
  <p>ok I don't have the main code but this is going to be the structure of  this experiment</p>
  
  <pre><code>#include &lt;ctype.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;string.h&gt;
  #include &lt;getopt.h&gt;
  #include "display_usage.c"/*If the user enters wrong arguments it will tell them how it should be */
  
  
  void cut( const char *file, int option, int first, int last );
  
  
  int main(int argc, char *argv[] ) {
  FILE *fp;
      char ch;
      fp = fopen("test.txt", "r"); // Open file in Read mode
  
      while (ch!=EOF) {
          ch = fgetc(fp); // Read a Character
  
          printf("%c", ch);
      }
      fclose(fp); // Close File after Reading
     return 0;
  }
  
  void cut( const char *file, int reverse, int first, int last ) {
  
  
  
      return;
  }
  </code></pre>