'C backslash newline in the middle of word emits error
The GNU CPP says about backslash new lines
A continued line is a line which ends with a backslash, ‘\’. The backslash is removed and the following line is joined with the current one. No space is inserted, so you may split a line anywhere, even in the middle of a word. (It is generally more readable to split lines only at white space.)
When I compile the following, breaking the printf word I get an error like:
error: unknown type name 'prin'
// Online C compiler https://www.programiz.com/c-programming/online-compiler/
#include <stdio.h>
int main() {
// Write C code here
prin\
tf("Hello world");
return 0;
}
Why are the lines not joined together?
Solution 1:[1]
The lines are joined together. However, as the second line starts with indent, you end up with prin tf. Remove all leading white space on the line with tf, and it will compile.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nick Zavaritsky |
