reference-type
why string behaves as value type even though it is a reference type in c# [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: In C#, why is String 开发者_运维百科a reference type that behaves like a value type?[详细]
2023-03-28 23:27 分类:问答C# Confused with a list inside a struct (value type vs reference type)
So I found out today that structs and classes act differently when used to assign to variables in C#.. It\'s to my understanding that when I assign a struct to a variable, the variable stores a copy o[详细]
2023-03-22 10:39 分类:问答Assigning a variable of a struct that contains an instance of a class to another variable
In my understanding, 开发者_如何学Cassigning a variable of a struct to another variable of the same type will make a copy. But this rule seems broken as shown on the following figure. Could you explai[详细]
2023-03-15 07:51 分类:问答Slight confusion over reference types and value types in the C# spec
I\'m trying to digest this statement in the C# spec, which states (§4.2): A reference type is a class type, an interface type, an array type, or a delegate type.开发者_运维知识库[详细]
2023-03-12 09:39 分类:问答Specify that an interface can only be implemented by reference types C#
If I declare an interface in C#, is there any way I can explicitly declare that any type implementing that interface is a reference type?[详细]
2023-03-10 19:02 分类:问答What does Python treat as reference types?
I assumed sequence types in Python were value types. It turns out they\'re reference types (Meaning that the value of a variable won\'t be copied when assigned to a new variable, but ref开发者_StackOv[详细]
2023-03-09 02:21 分类:问答Value type and reference type problem
Hi I\'m trying to do a simple swap of two objects.My code is void Main() { object First = 5; object Second = 10;[详细]
2023-03-07 01:30 分类:问答Convert object namespace and name to object
I need to call SetSettings() and using the 3 elements in splitSettings, set EncodeAudio to False. How would I go about doing that?Convert the property of a object to who\'s name I have in a string.[详细]
2023-02-25 02:41 分类:问答Does it make sense to define a struct with a reference type member?
Is there any sense in defining a struct with a reference type member (and not defining it as a class)? For example, to define this struct:[详细]
2023-02-24 07:12 分类:问答Dilemma with using value types with `new` operator in C#
When operator new() is used with reference type, space for the instance is allocated on the heap and reference variable itself is placed on the stack. Besides that, everything within the instance of r[详细]
2023-02-22 23:18 分类:问答