+ 1

What is the difference between Class and structure?

6th May 2017, 10:16 AM
Venkateshwaran K S
Venkateshwaran K S - avatar
3 Answers
+ 1
Struct is a value type, it doesn't support inheritance. By value type I mean if you declare an instance of a Struct and copy it to another var, it will create a totally different entity with same value but different memory addresses, While class is a reference type, it support inheritance. and if we copy one instance into other it will only pass the address reference. so if you change one, other will change its value too because both are on same memory address.
13th May 2017, 9:06 PM
Hamza Ahmed Khan
Hamza Ahmed Khan - avatar
0
Thank You so much bro👍
6th May 2017, 10:29 AM
Venkateshwaran K S
Venkateshwaran K S - avatar