Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Assuming inFile has been used before.
- char ch;
- char buffer[1000];
- size_t pos = 0;
- ch = fgetc(inFile);
- 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 the line that is terminated by '\0'
- }
- ch = fgetc(inFile);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement