Thursday, May 15, 2014

Struct_Notes

Struct
=======
A struct is a lightweight class.
Use the keyword 'struct' to define a structure.
Struct is value type, (class is reference type).



Every application has local memory (called STACK), and
HEAP memory shared by all applications which is managed by OS.
When we create objects
Variable (eg. person) will store in STACK
and new object will store in HEAP

Difference Value type and Reference Type
Value type make new copy (Struct_lightweight class)
Reference type refer to HEAP (Class)

*Use struct for small classes.

More about struct: Click here

No comments:

Post a Comment