C# guides
Every published C# guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular C# guides
Most readLatest C# guides
Page 77 of 77C# var Keyword Usage: Type Inference Explained
C# var declares a local variable without spelling out the type. Learn how type inference works, when var helps with LINQ and anonymous types, and when explicit types are clearer.
C# Variable Declaration vs Initialization
Understand the difference between declaring and initializing variables in C#, including default values, definite assignment, var inference, nullable reference types, and field initialization.
C# Variable Initialization: Rules and Defaults
C# initialization rules: default field and array values, definite assignment for locals, CS0165, default(T), and how ref/out arguments must be set.
C# Variable Declaration: Syntax and Practical Usage
How to declare C# variables: type-then-name syntax, var vs explicit types, nullable annotations, default values, and block scope rules with examples.