Tag - value types

C# Keywords Tutorial Part 81: struct

In C#, the struct keyword is used to define value types that can contain data members and methods. Unlike reference types such as classes, value types are stored directly in memory, making them more efficient in terms of performance. In this blog post, we will explore the struct keyword in more detail and provide...

C# Keywords Tutorial Part 77: sizeof

Developers frequently employ the contemporary programming language C# to create a variety of apps. It offers a wide range of features to assist programmers in writing effective and efficient code. One such feature is the "sizeof" keyword, which is utilized at compile time to ascertain the size of a value type. The "sizeof" keyword...

C# Keywords Tutorial Part 20: default

The "default" expression in C# is used to set a variable's default value at initialization time. When working with generic classes or resetting a variable to its initial value after use, it is especially helpful. The "default" term will be discussed in detail in this article, along with its usage in some sample code. What...