Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

πŸ€– Artificial Intelligence
☁️ Cloud and Infrastructure
πŸ’Ύ Data and Databases
πŸ’Ό Professional Skills
🎯 Programming and Development
πŸ”’ Security and Networking
πŸ“š Specialized Topics
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
Β© 2026 CheatGridβ„’. All rights reserved.
Privacy PolicyTerms of UseAboutContact

C# Programming Language Cheat Sheet

C# Programming Language Cheat Sheet

Back to Programming Languages
Updated 2026-04-28
Next Topic: C++ Programming Language Cheat Sheet

C# is a modern, object-oriented programming language developed by Microsoft as part of its .NET initiative, first released in 2000 and currently at version 14 (2026, .NET 10). It combines type safety and garbage collection with fine-grained control when needed, running on the Common Language Runtime (CLR) which provides cross-platform support. The language has evolved significantly with features like async/await, LINQ, pattern matching, nullable reference types, and now extension members that prioritize developer productivity and code safety. Think of C# as a strongly-typed, garbage-collected language where you rarely manage memory manually but gain full low-level control via unsafe contexts, Span<T>, and stackalloc β€” understanding this balance between safety and performance is key to mastering the language.

What This Cheat Sheet Covers

This topic spans 28 focused tables and 316 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Value Types and Built-in TypesTable 2: Operators and ExpressionsTable 3: Control Flow and LoopsTable 4: Collections and ArraysTable 5: String Manipulation and FormattingTable 6: Object-Oriented Programming (OOP)Table 7: Properties and IndexersTable 8: Methods, Parameters, and SignaturesTable 9: Delegates, Events, and LambdasTable 10: LINQ (Language Integrated Query)Table 11: Async/Await and Task Parallel LibraryTable 12: Exception HandlingTable 13: GenericsTable 14: Nullable Types and Pattern MatchingTable 15: Memory Management and Resource DisposalTable 16: Type Casting and ConversionTable 17: Attributes and ReflectionTable 18: Access Modifiers and Member ModifiersTable 19: Advanced Type FeaturesTable 20: Iterators and yieldTable 21: Multithreading and SynchronizationTable 22: File I/O and StreamsTable 23: Namespaces and Project OrganizationTable 24: Operator Overloading and EqualityTable 25: Expression-Bodied MembersTable 26: C# Version-Specific FeaturesTable 27: Span<T>, Memory<T>, and High-Performance PatternsTable 28: File-Based Apps (C# 14 / .NET 10)

Table 1: Value Types and Built-in Types

TypeExampleDescription
int
int x = 42;
β€’ 32-bit signed integer
β€’ range -2,147,483,648 to 2,147,483,647
β€’ most common integer type.
long
long y = 9_223_372_036_854_775_807L;
β€’ 64-bit signed integer
β€’ use L suffix for literals
β€’ for values exceeding int range.
double
double pi = 3.14159;
β€’ 64-bit floating-point
β€’ default for decimal literals
β€’ ~15–17 digits precision.
float
float f = 3.14f;
β€’ 32-bit floating-point
β€’ requires f suffix
β€’ ~6–9 digits precision.
decimal
decimal price = 19.99m;
β€’ 128-bit high-precision
β€’ requires m suffix
β€’ 28–29 digits precision
β€’ ideal for financial calculations.
bool
bool isValid = true;
β€’ Boolean type; only true or false
β€’ no implicit conversion from integers.
char
char c = 'A';
β€’ Single 16-bit Unicode character
β€’ use single quotes
β€’ supports escape sequences like '\n'.

More in Programming Languages

  • Arrays & Strings Cheat Sheet
  • C++ Programming Language Cheat Sheet
  • Clojure Programming Language Cheat Sheet
  • Julia Programming Language Cheat Sheet
  • Python Libraries Cheat Sheet
  • TOML Configuration Format Cheat Sheet
View all 31 topics in Programming Languages