Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is reference type and value type in c#

What I have tried:

what is reference type and value type in c#
Posted
Updated 21-Aug-16 22:23pm
Comments
Mehdi Gholam 22-Aug-16 2:32am    
Google is your friend.

Value Type
> Holds data in its own memory location
> Stored in Stack. Remember like this Value - Stack
> inbuilt data types such as int, byte, are value type. Except (string)
> When you want data to get accessed faster use this. however its scope is limited

Reference Type
> Pointer to other memory location
> Stored on heap. Remember like this Reference - heap
> User defined are ref. Ex. classes, arrays, string(even though inbuilt)
> When you want to share data, use this.
 
Share this answer
 
Comments
Member 12599631 22-Aug-16 4:40am    
thanks
 
Share this answer
 
Comments
Member 12599631 22-Aug-16 3:19am    
thanks
CPallini 22-Aug-16 3:22am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900