Suppose I have this function:
std::string Func1(std::string myString)
{
//do some string processing
std::string newString = Func2(myString)
return newString;
}
how do I set a conditional break when newString
has a specific value ? (without changing the source)
setting a condition newString == "my value"
didn't work the breakpoints got disabled with an error "overloaded operator not found"
There is a much easier way in Visual Studio 2010/2012.
To accomplish what you are looking for in ANSI use this:
strcmp(newString._Bx._Ptr,"my value")==0
And in unicode (if newString were unicode) use this:
wcscmp(newString._Bx._Ptr, L"my value")==0
There are more things you can do than just a compare, you can read more about it here: