Article ID: 158207 - View products that this article applies to.
This article was previously published under Q158207
This article has been archived. It is offered "as is" and will no longer be updated.
Note Microsoft Visual C++ .NET 2002 and Microsoft Visual C++ .NET 2003 support both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code. Microsoft Visual C++ 2005 supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model.
The sample code below illustrates how to use the string::operator+ STL function in Visual C++.
Note The class/parameter names in the prototype may not match the version in the header file. Some have been modified to improve readability.
DescriptionThere are five versions of the string::operator+ function. Two functions are used to concatenate a null-terminated character array and a basic_string. Two functions are used to concatenate a character and a basic_string. The last function is used to concatenate two basic_string variables.
Program Output is:
For more information about string::operator+, visit the following Microsoft Developer Network (MSDN) Web site:
Article ID: 158207 - Last Review: January 9, 2015 - Revision: 5.1