Original Post
I had a really wierd problem suddenly pop up with my usage of string (std:
. So I made a simple test program and still got the same results. The problem occurs when I try to append 16 or more characters to a string (test prog follows)
-------
#include <string>
int main()
{
string x = "12345678901234"; //x="12345678901234" - alls good
x += "5"; //x="123456789012345"
x += "6"; //<--- problem occurs here (x="h,2")
x += "7"; //x="h,2"
return 0; //"h,2" can be other random characters as well
}
-------
This is using Visual Studio .NET Professional. I was certainly using strings before today, without this problem (*curses himself for not using source control at home*). Anyways, the problem doesn''t occur using the exact same code in Visual Studio 6.0.
Looking at the string (x) in quickwatch - there''s a weird member in the .NET version of string called _Bx (which contains two variables: _Ptr (char *) and what would appear to be the trouble maker - _Buf (char[16])). In the VS6.0 version the only member string has is _Ptr, I can''t figure out where that char[16] comes from - or what made it start occuring today...
Thank you very much for any ideas on what the problem is. Let me know if you need more info.
-laotzu