I know there are no pointers in C#, but I am trying to figure out how to do the following, which I would have done with pointers (or better yet, iterators) in C++ (I am taking a course in C#, but I already know C++).
We got an assignment to write a simple "store" program (inventory, transactions, etc.). My first idea (coming from C++) was this: have a linked list of items and their amount in stock. Then, have a class representing a sale, which has a list of the items in the current sale, where each item is represented as an iterator to specific items in the master stock list and a value for the amount. (I hope this is clear.)
I tried to do the same in C# but can't figure out how to get those iterators to the master list (they should preferably also be good across updates to the master list). How do you do this?