共用方式為


_bstr_t::operator +=、+

Microsoft 特定的

將字元附加至 _bstr_t 物件的結尾或串連兩個字串。

_bstr_t& operator+=( 
   const _bstr_t& s1  
); 
_bstr_t operator+( 
   const _bstr_t& s1  
); 
friend _bstr_t operator+( 
   const char* s2, 
   const _bstr_t& s1  
); 
friend _bstr_t operator+( 
   const wchar_t* s3, 
   const _bstr_t& s1  
);

參數

  • s1
    _bstr_t 物件。

  • s2
    多位元組字串。

  • s3
    Unicode 字串。

備註

這些運算子會執行字串串連:

  • operator+=( s1 ):將 s1 的封裝 BSTR 中的字元附加至物件的封裝 BSTR 的結尾。

  • operator+( s1 ):傳回新的 _bstr_t,這是由串連此物件及 s1BSTR 組成。

  • operator+( s2 | s1 ):傳回新的 _bstr_t,這是由串連多位元組字串 s2 (已轉換為 Unicode) 及封裝在 s1 中的 BSTR 組成。

  • operator+( s3**,** s1 ):傳回新的 _bstr_t,這是由串連 Unicode 字串 s3 和封裝在 s1 中的 BSTR 組成。

END Microsoft 特定的

請參閱

參考

_bstr_t 類別