Advertisement
joannakr

Untitled

Jan 2nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. while (fgets(line, 300, fp))
  2. {
  3. int string_flag = 0, comment_flag = 0;
  4. int i = 0;
  5. int len = strlen(line);
  6. emptyLine++;
  7. for (i = 0; i < len; i++)
  8. {
  9. if (line[i] == '"')
  10. !string_flag;
  11. if (line[i] == '//' || line[i] == '/*')
  12.  
  13. {
  14. comment_flag = 1;
  15. string_flag = 0;
  16. }
  17.  
  18. if (line[i] != '\n' && line[i] != '\t' && line[i] != ' ')
  19. {
  20. emptyLine--;
  21. break;
  22. }
  23. }
  24. if (strstr(line, "while") || strstr(line, "do") || strstr(line, "for"))
  25. {
  26. logical++;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement