1

I dynamically assigned an array as follows:

unsigned char **nonces=new unsigned char*[n_cases]

Is there a way to nicely print it out in the immediate window? Alternatively, it would be nice to make the locals window display it properly.

Casebash
  • 114,675
  • 90
  • 247
  • 350

1 Answers1

1

Standard problem with C arrays, not even the debugger can know how long they are. You have to tell it that with a watch expression like nonces[0],12. You tagged this with C++/CLI, it is not a problem with managed arrays:

array<array<unsigned char>^>^ nonces = gcnew array<array<unsigned char>^>(n_cases);
nonces[0] = gcnew array<unsigned char>(42);
// etc..
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • So there is a nice way for the locals window, but not for the immediate window or does the expression work in both? – Casebash Oct 22 '10 at 08:12
  • It works in both the immediate window and the watch. Other format specifiers are available too: http://msdn.microsoft.com/en-us/library/75w45ekt%28VS.80%29.aspx – Casebash Oct 24 '10 at 22:12