943,712 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 455
  • C# RSS
Feb 4th, 2009
0

What's the diference between STRUCTS and OBJECTS in C#??

Expand Post »
Sorry, I'm a newbe here so ... I got to ask, what's the diference between those 2 things??

Can anybody help me!!.
Last edited by danielernesto; Feb 4th, 2009 at 6:43 pm.
Reputation Points: 9
Solved Threads: 2
Newbie Poster
danielernesto is offline Offline
16 posts
since Nov 2007
Feb 4th, 2009
1

Re: What's the diference between STRUCTS and OBJECTS in C#??

A struct defines a value type; a class defines a reference type.

A value type is one whose values cannot be separated from the variable. If you try copying it to a different variable, you'll make a complete copy. You don't really modify value types -- you modify the variables that contain them.

Compare this with class types, where variables contain references that point to objects -- where two variables of that type may contain references that point to the same object.
Team Colleague
Reputation Points: 1135
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005
Feb 4th, 2009
0

Re: What's the diference between STRUCTS and OBJECTS in C#??

Thanks that was very usefull,
I'll keep it in mind for a few projects =D
Reputation Points: 9
Solved Threads: 2
Newbie Poster
danielernesto is offline Offline
16 posts
since Nov 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Get index of an enum by value
Next Thread in C# Forum Timeline: Snippet - My first app - Opinions? Suggestions?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC