Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. char ch;
  2. char buffer[1000];
  3. size_t pos = 0;
  4. while (ch != EOF) {
  5.     buffer[pos] = ch;
  6.     if (ch == '\n') {
  7.         buffer[pos] = '\0';
  8.         // Reset the position for next usage
  9.         pos = 0;
  10.  
  11.         // At this point, buffer contains all the line that is terminated by '\0'
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement