fork download
  1. #define COMMENT_START_CHAR ';'
  2. #define STRING_FIRST_CHAR ' '
  3.  
  4. void SkipComment(FILE *fp) {
  5. char c = fgetc(fp);
  6. while(c != '\n' || c != EOF) {
  7. c = fgetc(fp);
  8. }
  9. }
  10.  
  11. FILE *SkipToNextOrder(FILE *fp) {
  12. char c;
  13. while ((c = fgetc(fp)) != EOF) {
  14. if (c == COMMENT_START_CHAR) {
  15. SkipComment(fp);
  16. } else {
  17. if (c > STRING_FIRST_CHAR) return fp;
  18. }
  19. }
  20. return NULL;
  21. }
  22.  
Success #stdin #stdout 0s 2244KB
stdin
Standard input is empty
stdout
Standard output is empty