Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char ch;
- char buffer[1000];
- size_t pos = 0;
- while (ch != EOF) {
- buffer[pos] = ch;
- if (ch == '\n') {
- buffer[pos] = '\0';
- // Reset the position for next usage
- pos = 0;
- // At this point, buffer contains all the line that is terminated by '\0'
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement