5

How can I see data behind a pointer to an array more than the first item in Visual Studio 2008? It would be so useful to see arbitrary amount of items, not just the first one.

1

2 Answers 2

10

char* p = new char[100];

Type in the Watch window:

p, 100

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

1 Comment

If your array is quite long, you can also add an offset to see the N positions after the n-t, with (p+n),N. See http://support.microsoft.com/kb/198953/en-us.
4

To expand on Alex's answer (and maybe get myself a few more votes :) ), here is the full list of debugger window format specifiers.

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.