C# Types

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajanipro
    New Member
    • Jul 2007
    • 11

    #1

    C# Types

    In C#, what is the size and range (on 32-bit and 64-bit platform) of the built-in reference types: string and object; user-defined reference types: class, interface, delegate and array; and user-defined value types: enum and struct?

    Further, is DateTime a value type or reference type and what is its size and range (on 32-bit and 64-bit platform)?

    Lastly, like VB .NET, does the size of built-in value type: bool, depend on the platform?
  • TRScheel
    Recognized Expert Contributor
    • Apr 2007
    • 638

    #2
    Originally posted by rajanipro
    In C#, what is the size and range (on 32-bit and 64-bit platform) of the built-in reference types: string and object; user-defined reference types: class, interface, delegate and array; and user-defined value types: enum and struct?

    Further, is DateTime a value type or reference type and what is its size and range (on 32-bit and 64-bit platform)?

    Lastly, like VB .NET, does the size of built-in value type: bool, depend on the platform?
    1) The memory they use should be dependent on the object, but the reference itself should be the same size for all objects (its a pseudo-memory address). As far as the exact numbers, I am unsure, but I believe they are dynamic

    2) An object is a value type if it is a struct, enum, or base item (int, byte, char, etc). Easy way to see if it is a ValueType is to check if it inherits System.ValueTyp e.

    3) No, it is platform independent.

    Comment

    • rajanipro
      New Member
      • Jul 2007
      • 11

      #3
      Thank you very much indeed!

      Comment

      Working...