Debug and see contents of variable passed by reference

Hi

I am working on a program where I have to pass a variable by reference, but the problem is that as I step through the function the debugger in Dev-C++ it only shows the location of the variable referenced but not the actual contents. How can I look at the value stored in the variable (it is a reference to a std::string)?
Last edited on
Can you provide your parts of code where you are defining and calling function?
Real programmers don't use external debuggers You could try inserting a printf or cout statement that fetches the value just before some breakpoint.

-Albatross
closed account (jwC5fSEw)
There's no reason to use print statements when you can use the debugger itself. Are you using MinGW with Dev-C++? If so, you're using GDB, and the GDB command to get the value of a variable is "print var_name".
Topic archived. No new replies allowed.