how to create conditional breakpoint with std::string

前端 未结 11 1013
粉色の甜心
粉色の甜心 2020-12-07 12:54

Suppose I have this function:

std::string Func1(std::string myString)
{
   //do some string processing 
   std::string newString = Func2(myString)
   return          


        
11条回答
  •  Happy的楠姐
    2020-12-07 13:52

    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:

    http://blogs.msdn.com/b/habibh/archive/2009/07/07/new-visual-studio-debugger-2010-feature-for-c-c-developers-using-string-functions-in-conditional-breakpoints.aspx

提交回复
热议问题