Guest User

Untitled

a guest
Jul 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. int seek_to_start_of_line(FILE *file) {
  2. int neg_count = 0;
  3. while(1) {
  4. char c = fgetc(file);
  5. if(c == EOF) {
  6. return;
  7. }
  8. if(c == (char) -1 ){ //'ΓΏ') {
  9. neg_count++;
  10. continue;
  11. }
  12. if(c == '\n') {
  13. if(neg_count == 4) {
  14. return;
  15. } else {
  16. neg_count = 0;
  17. }
  18. } else {
  19. neg_count = 0;
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment