While I had to work around this using something similar to Brad's answer (plus using DebugBreak () to break straight from the code), sometimes editing / recompiling / re-executing bits of code is either too time-consuming or simply impossible.
Fortunately, this is apparently possible for use in the actual members of the std :: string class. One way is mentioned here - and although it calls VS2010 specifically, you can access individual characters manually in earlier versions. Therefore, if you use 2010, you can simply use the beautiful strcmp() functions, etc. ( more) , but if you, like me, and still have 2008 or earlier versions, you can come up with a frantic, scary, but functional alternative by setting a conditional breakpoint like:
strVar._Bx._Ptr[0] == 'a' && strVar._Bx._Ptr[1] == 'b' && strVar._Bx._Ptr[2] == 'c'
if the first three characters in strVar are "abc". Of course, you can continue to use additional characters. Ugly ... but it saved me a little time.
Doug Kavendek Apr 22 '11 at 16:18 2011-04-22 16:18
source share