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

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Nov 2007
Posts: 16
Reputation: danielernesto is an unknown quantity at this point 
Solved Threads: 1
danielernesto danielernesto is offline Offline
Newbie Poster

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

 
0
  #1
Feb 4th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,047
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

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

 
1
  #2
Feb 4th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 16
Reputation: danielernesto is an unknown quantity at this point 
Solved Threads: 1
danielernesto danielernesto is offline Offline
Newbie Poster

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

 
0
  #3
Feb 4th, 2009
Thanks that was very usefull,
I'll keep it in mind for a few projects =D
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC