fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. int start_index = 1;
  6. int loop_count = 6;
  7. char inputline[] = "This is my day in 2020 1230023";
  8. char substr[1024];
  9.  
  10. strncpy ( substr, inputline + start_index, loop_count);
  11. substr[loop_count] = '\0';
  12. printf("%s\n", substr); // you can use fprintf(outfile, "%s", substr); here
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
his is