Line splicing in c/c++

Definition : Lines terminated by a backslash(\) are specified together with the next line very early in the process of translation.

Meaning and use : If we use a backslash (\) at the end of a comment line then the ending backslash makes the next line also a comment for the Compiler.

EX : 

int main () {
    //line splicing \
    printf("Hello\n") ;
    printf ("welcome") ;
    return 0;
} 

Output : welcome

Reason : the line printf ("welcome") ; treated as a comment by Compiler because at line the commented line is ending with a \. 

Posted on by