Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Value Type vs. Ref Type

Value Type vs. Ref Type

Scheduled Pinned Locked Moved C#
visual-studioquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hatim_ali
    wrote on last edited by
    #1

    Hi, Which one is faster ?? Value Type or Reference Type. Regards, Hatim Ali.

    S S 2 Replies Last reply
    0
    • H hatim_ali

      Hi, Which one is faster ?? Value Type or Reference Type. Regards, Hatim Ali.

      S Offline
      S Offline
      sreejith ss nair
      wrote on last edited by
      #2

      hi, I don't know in which sence that you are asking 'Value Type or Reference Types are fast'. I recommand you to read some C# syntax and C# basics. Value type and reference types are two type of Common Type System. We can say all numeric types are value type and which are stored in stack memory. Variables of reference types, referred to as objects, store references to the actual data. Reference type store data in Managed Heap memory. And the visibility of both types are entirly different. In some cases we need to convert value type to reference type or reverse. So this is also possible. Converting value type data into reference type data is called BOXING. Converting Reference type data into value type data is called UNBOXING. I recommand you to read MSDN or some book which explain the C# language. ************************** S r e e j i t h N a i r **************************;)

      1 Reply Last reply
      0
      • H hatim_ali

        Hi, Which one is faster ?? Value Type or Reference Type. Regards, Hatim Ali.

        S Offline
        S Offline
        Salil Khedkar
        wrote on last edited by
        #3

        Objective answer: Value types are faster. Notes: If you have a finite (and preferably short) storage requirement, value types (for example a structure) are your best friends. But use them lavishly and you will end up with a Stack overflow.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups