Solved

What is difference between class and data strcture

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

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 70

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hey Audio! 9 45
Jquery/JSON passing value from one function to another 12 62
c# - Best approach for objects in functions 3 24
Where does legacy ASP.NET initialize language? 2 27
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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