0

when i have a var like char my_array[23] I can see it all the array value by click on name and expanding the array.

but I can do it when var is like char *my_data I see only first data.

how debugger in vc++ can have same behavior for this two case?

1
  • You don't know how many elements the pointer points to. The debugger doesn't know either. The only safe answer is "one". Commented Jan 26, 2012 at 10:31

2 Answers 2

1

Because they are different types, in the first case (char[23]) debugger knows how many elements are in array, the second case (char*) is just a pointer to char and debugger shows only the first element of the array

Sign up to request clarification or add additional context in comments.

Comments

1

you must write in watch window

my_data,23

and can expand it like a array.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.