For example,
structure S{
int a;
int *b;
}s;
//now when I try to check the values stored…
s->a = ?
s->b[0] = ?
s->b[1] = ?
.. and so on
How do I “add watch” or use any other technique to check the values? Please let me know. Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It sounds like you have a value of type
S*that you want to inspect in the debugger. The easiest way to do this is simply type the expression which produces the value into the watch window. So for example if you have a local namedpValuesimplyThe tricky part is seeing all of the values in
S::bas it will be displayed as a single pointer vs. an array. In order to see the value as an array you just need to tell the debugger how many elements there are. For example if there were 5 elements you could type the following into the watch windowExpanding that will show you the first 5
intvalues inpValue->b