這是我多年來不時嘗試的東西,從來沒有成功過。我只想爲基於字符串相等性的Visual C++ 2012設置一個條件斷點。我想測試的變量是如何在Visual Studio中基於字符串比較設置條件斷點?
string test;
我試圖
test == "foo"
=> The breakpoint cannot be set. no operator "==" matches these operands
test == string("foo")
=> The breakpoint cannot be set. no operator "==" matches these operands
test.compare("foo") == 0
=> The breakpoint cannot be set. This expression has side effects and will not be evaluated.
strcmp(test.c_str(), "foo") == 0
=> The breakpoint cannot be set. This expression has side effects and will not be evaluated.
是的,該帖子回答了我的問題,OBWANDO的解決方案也適用於我。感謝您指出了這一點。 –