While writing a program, sometimes we give comment about the working of the code in the comment section with the help of single/double comment line. But we had never thought that if at the end of this comment line if we use \(backslash) character then what will happen?
The answer of the above question is line Splicing. Lines terminated by a \ are spliced together with the next line very early in the process of translation. §2.2 Phases of translation.
Actually whenever at the end of the comment line if we use \(backslash) character then it deletes the backslash character and the preceding next line of code only from the entire program or we can say that the ending \(backslash) makes the new line also as a comment for the compiler.
Explanation: In the above program as we can see when we use the \(backslash) character at the end of comment line. Then the next line of code is treated as comment in the program and the output is welcome.
This article is contributed by Bishal Kumar Dubey. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Equation of straight line passing through a given point which bisects it into two equal line segments
- C program to print odd line contents of a File followed by even line content
- Program to delete a line given the line number from a file
- Command line arguments example in C
- Draw a line in C++ graphics
- Command line arguments in C/C++
- LEX program to add line numbers to a given file
- Swap two variables in one line in C/C++, Python, PHP and Java
- Write one line functions for strcat() and strcmp()
- getopt() function in C to parse command line arguments
- Write a one line C function to round floating point numbers
- Strict Aliasing Rule in C with Examples
- Difference between cout and puts() in C++ with Examples
- Difference between forward list and list in C++