简体   繁体   中英

Viewing the value of reference string in VS2008

I am using Visual Studio 2008 and I noticed that during debug mode if a string is passed by reference to a method then upon hitting a breakpoint the hover does not display the content of the string on the other hand a string that isnt passed by reference works fine. Any idea on how i can read the content of a string on a breakpoint in debug mode ? I am using VS2008

For example
void myfunct(std::string& val)
{
  --->breakpoint here - hover over val variable will not display value
}

However

void myfunct(std::string val)
{
  --->breakpoint here - hover over val variable will display value
}

You can the name val to the "watch" window in debug mode (if it's not in "auto" or "local"). I'm not sure if mouseover will work, though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM