memory address
im trying to simulate the memory management so i want first to allocate x bytes and then working inside that space only..
how can i know the address of my object in the memory?
thanks
thanks
However you need to be careful. These are normally not needed in most applications. What exactly are you trying to do? Simulate an OutOfMemoryException or something?
Also I'm not sure I understand what you are trying to do, so I can't answer the collection answer. What are you going to store in the collection?
Rather than telling me what you are trying do within code, tell me what you want to achieve in a broader scope.
How are you allocating the memory? In .NET you typically do not need to worry about allocating memory, it is done under hood when you create an instance of an object.
Objects created in C# (Assuming you are not using Unsafe Code) are placed in the Managed Heap, It has no permanent memory address coz it is constantly being moved by the GC(Garbage Collector)...
cheers,
Paul June A. Domag