• Top Posts

    What are the differences between a Class and a Struct?

    Given below are the differences between a Class and a Struct:

    Class :
    • Supports Inheritance
    • Class is Pass by reference (reference type)
    • Members are private by default
    • Good for larger complex objects
    • Can use waste collector for memory management


    Struct :
    • Does not support Inheritance
    • Struct is Pass by Copy (Value type)
    • Members are public by default
    • Good for Small isolated models
    • Cannot use Garbage collector and hence no Memory management

    No comments

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728