![]() |
In C++, strings are used to store a sequence of characters. The combination of multiple strings into a single one is called Concatenation. In this article, we will learn how to concatenate multiple strings in C++. Example Input: Concatenate Multiple C++ Strings in One LineIn the std::string class, the ‘+’ operator is overloaded to concatenate two strings. We can use this ‘+’ operator of the std::string to concatenate multiple strings into a single line. C++ Program to Concatenate Multiple Strings in One LineC++
Output
The Concatenated string is : Hello! Geek Welcome to GfG Time Complexity: O(N), where N is the total length of all the strings being concatenated. We can also use strcat() and append() function to concatenate multiple strings. |
Reffered: https://www.geeksforgeeks.org
C++ |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |