CSharpFeeds - All your C# feeds in one place.

Sponsors

Saturday, March 14, 2009

References are not pointers in C#

by luisabreu via LA.NET [EN] on 3/14/2009 11:20:55 AM

As you know, C# supports the concepts of references and value types. Most of the time, reference types tend to be presented as some sort of synonym for a memory address. I’ve seen it everywhere and I’ve used that analogy too when trying to help others to understand the difference between value types and reference types. Now, this kind of analogy tends to break when you start thinking about the memory model and on how GC works.

Say, if reference type is an address, then why do I need to pin it before saving a reference to that address? If you think about references without the address analogy, things start to make more sense…This is just an example of the kind of questions you might end up being asked when you use this sort of analogy to introduce reference types. Fortunately, we’ve got people like Eric Lippert who really  know their stuff and do have the time (and will!) to explain why that is not a good analogy.

email it!bookmark it!digg it!

Original Post: References are not pointers in C#

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us