Solved

What is difference between class and data strcture

Posted on 2011-09-10
4
311 Views
Last Modified: 2012-05-12
What is difference between class and data strcture?
0
Comment
Question by:N_Sri
4 Comments
 
LVL 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 100 total points
ID: 36517837
I would venture to say that the difference is insignificant. A data structure is just a way to organise data for efficient transferring and processing. A class can be thought of in the same manner. The only reason I hesitate to say they are one and the same is because you also have the concept of structures (i.e. struct) in C#.
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 350 total points
ID: 36518812
a lot of good resources:
http://msdn.microsoft.com/en-us/library/aa289521(VS.71).aspx
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/6923cbe6-12b7-4e97-a4f5-3d9ebdfc75f2
http://dotnetguts.blogspot.com/2007/07/struct-vs-class-in-net.html

from the second one:
Classes are stored in memory via a heap whereas structs are stored in memory via a stack. Stacks are faster and more efficient and there's no need for the CLR garbage collector ro reclaim memory for structs (which takes time and resources). Structs are value types and all value types are stored on the stack.
 
Basically, classes are reference types and structs are value types. Reference types get stored differently than value types. Value types are stored more efficiently but only when they contain little data.
0
 
LVL 15

Assisted Solution

by:navneethegde
navneethegde earned 50 total points
ID: 36520923
0
 

Author Closing Comment

by:N_Sri
ID: 36541402
thankyou
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now