CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2004
    Posts
    152

    Structures in VB.net

    do we suports Structures in vb.net, similar to C -

    Struct
    {
    }

    let me know if someone knows an answer to this.
    No one does a virgin, life ****s you anyways

  2. #2
    Join Date
    Sep 2001
    Location
    Montreal Canada
    Posts
    1,080

    Re: Structures in VB.net

    Nicolas Bohemier

  3. #3
    Join Date
    Oct 2004
    Posts
    152

    Re: Structures in VB.net

    This structure thing in VB.net actually supports methods and stuff, means that i behaves exactly like a class with the only difference that the struct cannot inherit information.

    then under what cases would i decide on the difference between a structure and a class?
    No one does a virgin, life ****s you anyways

  4. #4
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Structures in VB.net

    Structure is a value type.
    class is a reference type.

    That means that structure is more effective - when boxing isn't needed.
    Boxing is what happens when you need to treat a value type as reference type.

    There is plenty of material on that subject on the net.

  5. #5
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: Structures in VB.net

    Structures are generally good for simple, relatively small data types, particularly with value-type fields, that do not need to be inherited and do not require a constructor with no arguments.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured