Data Types and Variables in C# Series
A breakdown of the data types and variables in C#. Learn how value and reference types work, explore the numerical and string types, and dive into constants, bytes, and enumerations.
- 1
Learn everything you need to know about variables in C#. This guide covers how to declare variables, the rules around naming and scope, different kinds of variables including fields, parameters, loop variables, readonly and const.
- 2
Learn what data types are in C#, how they are used, and why type safety matters. Explore value vs reference types, common categories, and the strong typing system in C#.
- 3
A comprehensive introduction to C# strings, covering how they work under the hood, how to declare and format them, how to compare them correctly, and the practical stuff you hit every day, such as immutability, common operations, empty/null checks, and when to reach for
StringBuilder.