Are you using managed C ++ or C ++ / CLI? (I see that Jon Skeet has edited the question of adding C ++ / CLI to the header, but to me it looks like you are actually using Managed C ++).
But anyway:
In managed C ++, you do this as follows:
Byte data __gc [] = new Byte __gc [100];
In C ++ / CLI, it looks like this:
cli::array<unsigned char>^ data = gcnew cli::array<unsigned char>(100);
source share