I’m experimenting with the Visual Studio 11 Dev Preview. I’ve got a problem domain which requires the use of “jagged” arrays, i.e., an array of arrays where the second dimension is not of uniform size. The MSDN documentation I’ve found only concerns multi-dimensional arrays where each dimension is fixed-size. Is there any way to emulate the behaviour desired?
I’m experimenting with the Visual Studio 11 Dev Preview. I’ve got a problem domain
Share
If you have a flat 1d array, which C++ AMP offers, you can emulate a lot of things, including jagged arrays. For example, you could build common sparse-matrix representations with one array containing the storage for elements and a second array containing offsets into the storage. However, in C# and Java jagged arrays are also meant to mean “an array with pointers to other (dynamically allocated) arrays”. That, is not something that will be straight forward to support, unless you’re simulating a whole heap inside an array, because C++ AMP doesn’t support pointers in arrays. What are you trying to achieve?