I’ve got a C# code that runs on Azure and is web enabled so it should be safe. That means I can’t use pointers.
I’ve got this problem – My Data structure is a SortedList where each node is an object X. Each object X includes an array where each cell is another SortedList of object Y. objects of type X and Y have distinct IDs (so they are searchable of course).
Now, I need a way to get directly to a Y object, without searching it through X objects and then Y objects. (It could be millions on objects)
In C/C++ I’d use a list of Y object IDs with pointers to the actual object. Such way I’d search only once for the object.
Any ideas how this could be accomplished in C#?
Thanks!
Just use instances in C# as you would in your C++ solution, but without the
->C++ pointer deref. All things that refer to an instance of a class type in .NET are object references, which are actually pointers. If you construct an instance of a type in C# and assign it to a variable and an array element and pass it as an argument, all of those are pointers to the same object data in memory.No need to simulate pointers in C#. Everything already is a pointer.