Q: I set a breakpoint in my source code to see the value of a string variable:
But in QuickWatch and Watch windows I see only the first character of string, like in images below:
What can I do to see the entire string contents?
A: Your build configuration is a UNICODE one, i.e. 'UNICODE' is added in 'Project Settings\C/C++\Preprocessor definitions'.
There are several solutions for the problem:
- Append to the variable name 'su' formatting symbol in Watch/QuickWatch window.
- Modify autoexp.dat file which is located in the same folder with msdev.exe.
See the comments in autoexp.dat and Symbols for Watch Variables topic in MSDN
- Last but not the least, go to Tools/Options/Debug and check 'Display Unicode strings'.