|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
: : Basic_string assign () parameters can be matched through translation?
: : Basic_string assign MSDN regarding the files :
---------------------------
: : Basic_string assign
Basic_string& assign (const calculate E);
Basic_string& assign (const E polarized, size_type n);
Basic_string& assign (const basic_string& str.
Size_type poses, size_type n);
Basic_string& assign (const basic_string& str);
Basic_string& assign (size_type n, Ec);
Basic_string& assign (const_iterator first, const_iterator last);
Each member function replaces the sequence controlled by *this with the operand sequence, then returns *this.
--------------------------------------
There is no basic_string& assign (char *, int, int), the prototype, but
[code]
#include "String>
Using namespace std;
Int main ()
{
Char *msg=new char[50];
DataPrimary string = "";
DataPrimary.assign (msg, 3, sizeof (msg));
}
[/code]
Compiler is able to. Only when abnormal operation
[xiangbin@S-TradingServer Test]$. /testAssign.bin
Terminate called after throwing an instance of 'Std : : out_of_range'
What () : : : basic_string assign
Aborted
Why is there no corresponding prototype, it can be translated through? Operation is how the mistake happened?
Also on the MSDN "CONST E. calculate," What kind?
Still do not know where I can find the API file on the C + + Standard Library. |
DataPrimary.assign (msg, 3, sizeof (msg));
Basic_string& assign (const basic_string& str.
Size_type poses, size_type n);
Not the same? ? ? |
Ah do not know. Basic_string & char * and the same? Can explain.
What is the abnormal operation when other reasons? |
Calling the basic_string the constructor function, with a char * basic_string to construct a temporary target, and then to the provisional target parameters Call basic_string& assign (const basic_string& str. size_type poses, size_type n); |
| |