Line Splicing in C/C++ Last Updated : 10 Jun, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 merges the immediate next line with current line which makes the new line also as a comment for the compiler. To avoid this issue multi-line comment can be used. C++ // C++ program to illustrate the concept of Line splicing. #include <iostream> using namespace std; int main() { // Line Splicing\ cout << "Hello GFG\n"; cout << "welcome\n"; /*Example 2 - both of the below lines will be printed*/ \ cout << "Hello\t"; cout << "World"; return 0; } // This code is contributed by sarajadhav12052009 C // C program to illustrate the concept of Line splicing. #include <stdio.h> int main() { // Line Splicing\ printf("Hello GFG\n"); printf("welcome\n"); /* Example 2 - both of the below lines will be printed*/ \ printf("Hello\t"); printf("World"); return (0); } Outputwelcome Hello World 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. When we use multiline comment this issue get solved and both of the below lines of multiline comment will be printed. Comment More infoAdvertise with us Next Article std::string::insert() in C++ B Bishal Dubey Improve Article Tags : C++ Practice Tags : CPP Similar Reads List splice() in C++ STL The list splice() is a built-in function in C++ STL used to transfer elements from one list to another. This function just reassigns the internal pointers of each node to the new position without copying or moving the data.Let's take a look at a simple example that shows the how to use list splice() 5 min read getline (string) in C++ The C++ getline() is a standard library function that is used to read a string or a line from an input stream. It extracts the characters from the input stream and appends it to the given string object until the delimiting character is encountered.Example:C++#include <bits/stdc++.h> using name 3 min read std::string::insert() in C++ In C++, the string insert() function is used to insert characters or a string at the given position of the string. For example,C++#include <bits/stdc++.h> using namespace std; int main() { string s = "Geeks"; // Inserting another string at the friend // of s s.insert(s.size(), "forGeeks"); cou 4 min read strcspn() function in C/C++ The strcspn() function in C/C++ takes two string as input, string_1 and string_2 as it's argument and searches string_1 by traversing for any characters that is present in string_2 . The function will return the length of string_1 if none of the characters of string_2 are found in string_1 . This fu 2 min read Printing Output in Multiple Lines in C++ This article focuses on discussing how to use cout for multi-line printing. This can be easily done using any of these two methods: Using endl.Using \n. Let's discuss each of these methods in detail. Using endl The endl statement can be used to print the multi-line string in a single cout statement. 2 min read Tokenizing a string in C++ Tokenizing a string denotes splitting a string with respect to some delimiter(s). There are many ways to tokenize a string. In this article four of them are explained:Using stringstreamA stringstream associates a string object with a stream allowing you to read from the string as if it were a stream 4 min read Like