Author: Unknown
Subject: Newline at the end of line variable
Date: Sunday, 23 Feb 2020, 23:19:25
When applying rules, should we worry about the newline character at the end of the variable "line"? As in, could there be rules where Fi is a newline character, and if so should we be modifying the newline at the end of "line"?
size_t n = 0; char *line = NULL;
while (getline (&line, &n, stdin) != -1) {
fputs (line, stdout);
free (line);
n = 0;
line = NULL;
}
free (line);
PREV
INDEX
NEXT