About 791,000 results
Open links in new tab
  1. How do you initialize an array in C#? - Stack Overflow

    Aug 6, 2009 · char[] charArray = new char[10]; If you're using C# 3.0 or above and you're initializing values in the decleration, you can omit the type (because it's inferred)

  2. C# Arrays - W3Schools

    Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value. To declare an array, define the variable type with square brackets:

  3. The array reference type - C# reference | Microsoft Learn

    Dec 14, 2024 · You can store multiple variables of the same type in an array data structure. You declare an array by specifying the type of its elements. If you want the array to store elements of any type, …

  4. Arrays in C# - GeeksforGeeks

    Sep 9, 2025 · Aarray is a reference type so the new keyword used to create an instance of the array. We can assign initialize individual array elements, with the help of the index.

  5. C# - Array Initialize - Dot Net Perls

    Aug 11, 2025 · The C# language specification describes array initializers. We see that an array initializer is converted to a sequence of assignments into the newly-allocated arrays.

  6. C# Array Tutorial: How to Declare, Initialize, Access & Use Arrays

    Learn how to declare, initialize, access, and manipulate arrays in C#. This guide covers sorting, copying, and finding the length of arrays with practical examples.

  7. C# Array Initialization: All Possible Syntax Options Explained with ...

    Nov 18, 2025 · This blog post explores **all possible array initialization syntaxes** in C#, with practical examples and explanations to help you choose the right approach for your use case.

  8. How to Initialize an Array in C#: A Complete Step-by-Step Guide

    Dec 9, 2025 · In this guide, we’ll explore all the ways to initialize arrays in C#, from basic one-dimensional arrays to complex multidimensional and jagged arrays. We’ll include step-by-step …

  9. C# Array: How To Declare, Initialize And Access An Array In C#?

    Apr 1, 2025 · Learn All About C# Array in This In-depth Tutorial. It Explains How To Declare, Initialize And Access Arrays Along with Types And Examples Of Arrays in C#.

  10. Initializing an Array in C# - DEV Community

    May 14, 2024 · This is the newest way to initialize an array in C# 12, simple and straightforward. It's also similar to the way arrays are initialized in Python and JavaScript.