Top "Value-type" questions

In computer science, the term value type is commonly used to refer to one of two kinds of data types: Types of values or Types of objects with deep copy semantics.

In C#, why is String a reference type that behaves like a value type?

A String is a reference type even though it has most of the characteristics of a value type such as …

c# string clr value-type reference-type
Changing the value of an element in a list of structs

I have a list of structs and I want to change one element. For example : MyList.Add(new MyStruct("john"); …

c# struct value-type
What is the difference between a reference type and value type in c#?

Some guy asked me this question couple of months ago and I couldn't explain it in detail. What is the …

c# .net value-type reference-type
Literal suffix for byte in .NET?

I am wondering if there is any way to declare a byte variable in a short way like floats or …

c# .net value-type
Convert.ToBoolean fails with "0" value

I'm trying to convert the value "0" ( System.String ) to its Boolean representation, like: var myValue = Convert.ToBoolean("0"); // throwing an exception …

c# types reference value-type type-conversion
Most efficient way to check if an object is a value type

WARNING: THIS CODE SUCKS, SEE ANTHONY'S COMMENTS Which is faster? 1. public bool IsValueType<T>(T obj){ return obj …

c# .net performance value-type
VB Check if int is empty

A really boring question, sorry, but I really don't know that yet ;) I've tried always string.empty, but with a …

vb.net integer value-type
C#: Getting size of a value-type variable at runtime?

I know languages such as C and C++ allow determining the size of data (structs, arrays, variables...) at runtime using …

c# variables runtime value-type
Swift and mutating struct

There is something that I don't entirely understand when it comes to mutating value types in Swift. As the "The …

struct value-type swift