C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
4
Reply
What is the difference between a Struct and a Class?
siva
19y
5.2k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
Struct is a value type and is stored in stack whereas class is a referenc type and stored in heap. You can implement all the object oriented programming techniques on class but not on struct.
pradeepa nandha
19y
0
Struct is a value type and is stored in stack whereas class is a referenc type and stored in heap. You can implement all the object oriented programming techniques on class but not on struct.
pradeepa nandha
19y
0
They have with some of them as follows:
Struct is used for value types whereas class is used for objects.
can not use inherit from struct
I usually use the struct to carry values around in classes...
And if I remember correctly, although struct has constructor, but it is always empty.
There are a few more differences which I do not remember at present.
farshad
19y
0
A struct is a group of methods and a class is a class of classes.
Bindu Punjab Amar Singh Nahasapeemapetalon Ganesh
19y
0
What is Reflection in .Net?
What is a base class?
Message