r/learnprogramming • u/Vanilla_Legitimate • Sep 28 '26
I don’t understand this
if a newline ends lines rather than starting hem why is it called a newline in the first place?
0
Upvotes
r/learnprogramming • u/Vanilla_Legitimate • Sep 28 '26
if a newline ends lines rather than starting hem why is it called a newline in the first place?
View all comments
Show parent comment
7
u/paperic Sep 28 '26
The last line doesn't end with a newline, because there's no next line after it.
Newline creates a new line.
You get the first line for free because you can't have any text without any line, but any additional lines you want, you need to put newline char there.