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. refrence type & Value type which better and why?

refrence type & Value type which better and why?

Scheduled Pinned Locked Moved C#
question
6 Posts 6 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.
  • M Offline
    M Offline
    monafr81
    wrote on last edited by
    #1

    In data Types , i would like to know what is the difference between refrence type and value type ,which is better in using and why ? thanks , Mona

    LA ELAH ELA ALLAH MOHAMED RASOL ALLAH

    P C C A 4 Replies Last reply
    0
    • M monafr81

      In data Types , i would like to know what is the difference between refrence type and value type ,which is better in using and why ? thanks , Mona

      LA ELAH ELA ALLAH MOHAMED RASOL ALLAH

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      The almighty, magical google[^] returned this.

      Deja View - the feeling that you've seen this post before.

      A 1 Reply Last reply
      0
      • P Pete OHanlon

        The almighty, magical google[^] returned this.

        Deja View - the feeling that you've seen this post before.

        A Offline
        A Offline
        Anthony Mushrow
        wrote on last edited by
        #3

        All hail google.

        My current favourite word is: Waffle Cheese is still good though.

        1 Reply Last reply
        0
        • M monafr81

          In data Types , i would like to know what is the difference between refrence type and value type ,which is better in using and why ? thanks , Mona

          LA ELAH ELA ALLAH MOHAMED RASOL ALLAH

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Actually, there's no point in worrying about this, because you don't really have a choice, most of the time. But, I assume google told you that already.

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          • M monafr81

            In data Types , i would like to know what is the difference between refrence type and value type ,which is better in using and why ? thanks , Mona

            LA ELAH ELA ALLAH MOHAMED RASOL ALLAH

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            It isn't a case of one being better than the other but of the situation you want to use them in. In the vast majority of cases you'll go with a reference type. Very rarely you might need to create a value type. Value types are copied each time you pass them around. Reference types don't get copied, a reference is passed instead.


            Upcoming FREE developer events: * Glasgow: SQL Server Managed Objects AND Reporting Services ... My website

            1 Reply Last reply
            0
            • M monafr81

              In data Types , i would like to know what is the difference between refrence type and value type ,which is better in using and why ? thanks , Mona

              LA ELAH ELA ALLAH MOHAMED RASOL ALLAH

              A Offline
              A Offline
              alisolution
              wrote on last edited by
              #6

              Ref Type: (a) is store data in heap memory And Accessing Through Refference. (b) Efficent And Fast Accessing Method. (c) Object type,Delegate,Interface,pointer is example that. value type: (a) is store data in stack memory And Accessing through ordinary variable. (b) Scope in Single block And another place duplicate complexity. (c) int,float,double,char etc. Beshak MOHAMED RASOL ALLAH ali

              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