2

For example, I wanna watch pA

int *pA = new int[LEN];

Then in visual studio, I can see only pA[0] in watch-window

I try to view '(int (*)[LEN])pA', but it does not work

I don't want to make

int (*test)[LEN] = (int (*)[LEN])pA

to debug

How can I see dynamic allocated pointer as a static array in debugger of VS2010?

1
  • 1
    You should probably be using std::vector<int>, though. Commented Jun 7, 2012 at 6:54

2 Answers 2

6

You can write pA,10 (or how many elements you want to see) in the watch window.

enter image description here

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

Comments

1

In the Quick Watch:

  • First know the value of LEN. Say, it is 100.
  • Then, type pA,100 to see all the 100 elements.

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.