For reference, the standard quotation (ยง2.2 / 1, abridged, highlighted by me):
Translation phases
[...]
2. Each instance of the backslash character ( \ ) immediately followed by a newline character is deleted by splicing the physical source lines to form the logical lines of the source . Only the last backslash in any physical line of the source should be allowed to be part of such a splicing. If the result is a sequence of characters that matches the syntax of the name of the universal character, the behavior is undefined. A source file that is not empty and that does not end with a newline or ends with a newline that is preceded by a backslash before any such merging occurs is processed as if a new, line symbol is added to the file .
[...]
The implementation-defined part that other answers mention is contained in the definition of a "new line."
(Note that comments are not replaced until step 3, so in this code:
int main() { int x = 0; // assuming the definition of new-line is as expected, this function // will return 0, not 5 (no whitespace after this backslash: ) \ x = 5; return x; }
x = 5; will be added to the end of the comment and then deleted.)
GManNickG Sep 06 2018-12-12T00: 00Z
source share