????? ??????? ?????? STL string::operator + ?? Visual C++

?????? ????????? ?????? ?????????
???? ???????: 158207 - ??? ???????? ???? ????? ????? ??? ???????.
?????? Microsoft Visual C++ .NET 2002 ???? Microsoft Visual C++ .NET 2003 ??? ??????? ?????? ??? ??????? ?????? ??????? ?? ???? Microsoft .NET Framework ? ???? ????????? ???????? ??? ???????? ?????? Microsoft Windows. ????? ????????? ??????? ?? ??? ??????? ??? ??? ??? ???? Visual C++ ????????? ????????.????? Microsoft Visual C++ 2005 ????? ????????? ???????? ??????? ???? ?? ??????? ?? ??? Microsoft .NET Framework ?????? ????? ????????? ???????? ??? ???????? Microsoft Windows ??????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ????? ???????? ???????? ????? ????? ??????? ?????? STL string::operator + ?? Visual C++.

??????? ????

??? ?????

   <string>
				

??????? ??????

   Function 1:
       template<class _E, class _TYPE, class _A> inline
       basic_string<_E, _TYPE, _A>
       operator+(const basic_string<_E, _TYPE, _A>& LString,
                 const _E *RCharArray);

   Function 2:
       template<class _E, class _TYPE, class _A> inline
       basic_string<_E, _TYPE, _A>
       operator+(const _E *LCharArray,
                 const basic_string<_E, _TYPE, _A>& RString);

   Function 3:
       template<class _E, class _TYPE, class _A> inline
       basic_string<_E, _TYPE, _A>
       operator+(const basic_string<_E, _TYPE, _A>& LString,
                 const _E RChar);

   Function 4:
       template<class _E, class _TYPE, class _A> inline
       basic_string<_E, _TYPE, _A>
       operator+(const _E LChar,
                 const basic_string<_E, _TYPE, _A>& RString);

   Function 5:
       template<class _E, class _TYPE, class _A> inline
       basic_string<_E, _TYPE, _A>
       operator+(const basic_string<_E, _TYPE, _A>& LString,
                 const basic_string<_E, _TYPE, _A>& RString);
				
?????? ?? ?? ????? ????? ???/?????? ?? ????? ??????? ??????? ?? ??? ?????. ?? ????? ??? ?????? ??????? ???????.

???

???? ???? ??????? ?????? string::operator +. ??? ??????? ????? ????? ???????? ???? ??? ????? ?????? "?" basic_string. ??? ??????? ????? ????? ???????? ??? ? basic_string. ??? ??????? ?????? ?????? ???????? ??????? basic_string ?????.

????? ????????? ????????

////////////////////////////////////////////////////////////////////// 
// 
// Compile options needed: /GX
// 
// StringPlus.cpp : Illustrates how to use the operator+ to concatenate
//                  a null-terminated character array and a basic_string,
//                  how to concatenate a character and a basic_string,
//                  and how to concatenate two basic_string variables.
// 
// Functions:
// 
//    operator+ : Concatenates a null-terminated character array and
//                a basic_string.
//    operator+ : Concatenates a character array and a basic_string.
//    operator+ : Concatenates two basic_string variables.
// 
// Written by Derek Jamison
// of Microsoft Product Support Services,
// Copyright (c) 1996 Microsoft Corporation. All rights reserved.
////////////////////////////////////////////////////////////////////// 

// The debugger can't handle symbols more than 255 characters long.
// STL often creates symbols longer than that.
// When symbols are longer than 255 characters, the warning is disabled.

#pragma warning(disable:4786)
#include <string>
#include <iostream>
using namespace std;

#if _MSC_VER > 1020   // if VC++ version is > 4.2
   using namespace std;  // std c++ libs implemented in std
   #endif

void main()

{

   string result;
   string S1="ABC";
   string S2="DEF";
   char CP1[]="GHI";
   char C='J';

   cout << "S1 is " << S1 << endl;
   cout << "S2 is " << S2 << endl;
   cout << "CP1 is " << CP1 << endl;
   cout << "C is " << C << endl;

   result=S1+CP1;                           // Function 1  (ABCGHI)
   cout << "S1+CP1 is " << result << endl;

   result=CP1+S1;                           // Function 2  (GHIABC)
   cout << "CP1+S1 is " << result << endl;

   result=S1+S2;                            // Function 3  (ABCDEF)
   cout << "S1+S2 is " << result << endl;

   result=S1+C;                             // Function 4  (ABCJ)
   cout << "S1+C is " << result << endl;

   result=C+S1;                             // Function 5  (JABC)
   cout << "C+S1 is " << result << endl;

}
				
??? ????? ????????:
S1 is ABC
S2 is DEF
CP1 is GHI
C is J
S1+CP1 is ABCGHI
CP1+S1 is GHIABC
S1+S2 is ABCDEF
S1+C is ABCJ
C+S1 is JABC
				

?????

????? ?? ????????? ??? string::operator + ?? ?????? ???? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
http://msdn.microsoft.com/en-us/library/ek0d1btk(VS.80).aspx

???????

???? ???????: 158207 - ????? ??? ??????: 09/?? ?????/1426 - ??????: 5.1
????? ???
  • The Standard C++ Library, ????? ?????? ??:
    • Microsoft Visual C++ 4.2 Enterprise Edition
    • Microsoft Visual C++ 5.0 Enterprise Edition
    • Microsoft Visual C++ 6.0 Enterprise Edition
    • Microsoft Visual C++ 4.2 Professional Edition
    • Microsoft Visual C++ 5.0 Professional Edition
    • Microsoft Visual C++ 6.0 Professional Edition
    • Microsoft Visual C++, 32-bit Learning Edition 6.0
    • Microsoft Visual C++ 2005 Express Edition
    • Microsoft Visual C++ .NET 2003 Standard Edition
    • Microsoft Visual C++ .NET 2002 Standard Edition
????? ??????: 
kbmt kbhowto kbcode kbinfo KB158207 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????158207

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com