开发者

Accessing Linked list across modules in C#

开发者 https://www.devze.com 2023-03-10 18:25 出处:网络
I have previously worked with Linked list in C++ where refering link list in different modules using pointer to acxcess the address of it.

I have previously worked with Linked list in C++ where refering link list in different modules using pointer to acxcess the address of it.

What I use to do is after creating the li开发者_如何转开发nked list use to store the address of the Linked list in long format. In another module is same application after type casting the address I am able to reconstruct the linked list.

New if C# world and not able to find a way to implement it. Please help me


Can you not just hold a reference to your Linked List and use it again whenever you need it?

LinkedList mylist = new LinkedList();

Now use mylist in whatever place you need it, by passing it around, preferrably.


What you probably don't know in C# by default all types except value types (simple types like int, string etc.) are passed in parameters as a reference to the object.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号