Hi everyone,
I just write a function that return string as below in visual studio for C++:
Code:
string func(int i1, int i2){
if(condition1)
return "A";
else if( condition2)
return "B";
else
return "C";
}
out side of this function, I defined a variable
string a;
Code:
void main(){
a = func(i1,i2);
}
the program was halted, and the break point stop at a line of a function as below in xstring file local on VS/include/xstring
Code:
void _Assign_rv(_Myt&& _Right)
{ // assign by moving _Right
if (_Right._Myres < this->_BUF_SIZE)
_Traits::move(this->_Bx._Buf, _Right._Bx._Buf,
_Right._Mysize + 1);
else
{ // copy pointer
this->_Getal().construct(&this->_Bx._Ptr, _Right._Bx._Ptr);
_Right._Bx._Ptr = pointer();
}
this->_Mysize = _Right._Mysize;
this->_Myres = _Right._Myres;
_Right._Tidy();
}
Please take a look and help me to solve my probelm.
Thank you so much!