Does the standard say anything about files ending with a newline?

C wants it, but I don’t know of any tool that would emit an error if it’s missing. The C++ standard states it will treat a file without the EOF newline as if it has one:

2.2.2 A source file that is not empty and that does not end in a new-line character, or that ends in a new-line character immediately preceded by a backslash character before any such splicing takes place, shall be processed as if an additional new-line character were appended to the file.

Does C# have any opinion on it?

submitted by /u/moswald
[link] [comments]

Leave a Reply