I am using C++ Builder XE3 and I have met a weird problem with AnsiString.
Just look at below code
//Code 1: first time
AnsiString temp1 = "test" ;
funcA(temp1,temp1);
//Code 2: second time
String uTemp2 = "test";
AnsiString temp2 = uTemp2;
funcA(temp2,temp2);
Out of my imagine, it works well in the first time, however it throws a "Bad Format" Exception in the second time. And even I just called funcA once with Code 2 the problem remained.
Since it makes no difference when I ShowMessage within temp1 or temp2. I totally can not understand why the two times of call gave me different results.
funcA is from a 3rd library with a little bit complicated code. So before I trace the code of this library I think I should know what the difference is with Code1 and Code2.
Thanks.