I am writing a simulation project in C++ using Visual Studio 2012 (standard C++ with no /clr support) and I face the following problem. In the code somewhere I pass a string by reference:
theClassObject->Method("12345") where the definition of the method in the class is:
TheClass::Method(const std::string& STR) {..} and when I check the value of the STR during debugging it has four more bytes in front, for example "~#.a12345" and the length of the string is increased by these four bytes. In other places of the code with other similar methods this does not happen.
Did I miss some compiler option for the project or there are other reasons I miss?
I am not sure if I provided all the information needed, but I could if needed.
Thanks in advance!
TheClass::Method(const std::string& STR). It is probably a debug configuration which is showing a wrong value.