Computer Store
store.prestwood.com
-Collapse +Expand
C#
Search C# Group:

Advanced
-Collapse +Expand C# To/From
To/FromCODEGuides
-Collapse +Expand C# Study Test
PRESTWOODCERTIFIED
-Collapse +Expand C# Store
PRESTWOODSTORE

Prestwood eMagazine

July Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingC#   Print This     
  From the December 2015 Issue of Prestwood eMag
 
C#:
Reference Data type variables
 
Posted 12 years ago on 2/27/2008 and updated 1/1/2009
Take Away:

Variables that only contain a reference to the values. Reference data type variables only contain a reference to it's constituent value.  Reference data types include objects and strings.  Assignment of one reference type variable to another copies the reference, thus changes to the values in one variable changes the values in the other.

C# Definition Flashcard:
 A flashcard from our C# Flashcards Library
 A definition from our C# Definitions Page

KB100896

Reference Data type variables -

Variables that only contain a reference to the values. Reference data type variables only contain a reference to it's constituent value.  Reference data types include objects and strings.  Assignment of one reference type variable to another copies the reference, thus changes to the values in one variable changes the values in the other.


Value Types versus Reference Types

The C# data types fall into either value or reference types. A value type is derived from System.ValueType, is allocated on stack, and contains data. When you assign a value type variable to another, a copy of the value is made.

A reference type is derived from System.Object, is allocated on heap, and contains the address of the memory location where the data is stored. When you copy a reference type variable, you copy only the reference to the variable.


Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P162A1
Enter key:
Definition Contributed By Daniel Fought:
Danial Fought is a senior programmer analyst with Prestwood IT where he develops custom Windows software and custom websites. When Dan is not coding for clients, he participates in this online community. Coding specialties include Paradox/ObjectPAL, MS Access, Visual Basic, and VS.Net/VB.Net.
Visit Profile

 KB Article #100896 Counter
9729
Since 4/2/2008


©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech