First off let me say very clearly: solving problems in C# using the same low-level pointer techniques as you would in C++ is almost always the wrong thing to do. There is usually a higher-level, safer technique you can use. What you're doing here is called an "XY question" -- you have a wrong idea about how to solve a problem, and you're asking a question about the wrong idea, instead of asking how to solve the real problem; please edit the question to say what the real problem is.
To answer your question that was asked: to make a "dynamic array" of pointers in C# you must make a List<IntPtr>
which is a list of "integers that are the same size as a pointer". Do not fall into the trap of believing that IntPtr
means pointer to integer. An IntPtr
is an integer that is the same size as a pointer.
You can then convert your int*
s to IntPtr
and store them in the list, and then convert them back again when you're done, but again, this is almost always the wrong thing to do, and if you do so then you are responsible for understanding everything about the .NET memory management system and how it works, because you are turning off the safety system that protects memory integrity.
Do you believe that you understand everything about how memory management works in C#? If not, then do not use pointer types in C#. I have been developing code in C# since 2001 and I have never used pointer types for anything in production code. You don't need them, and if you think you need them, you're probably doing something wrong.