About 1,540,000 results
Open links in new tab
  1. How to Initialize a 2D Array in C? - GeeksforGeeks

    Sep 12, 2024 · There are three main ways to initialize the 2D array in C: To initialize a 2D array, we can use a list of values enclosed inside the braces ' { }' and separated by a comma. Each …

  2. Declaring and initializing arrays in C - Stack Overflow

    Is there a way to declare first and then initialize an array in C? int myArray[SIZE] = {1,2,3,4....}; myArray = {1,2,3,4....}; In C99 you can do it using a compound literal in combination with …

  3. 2D Arrays in C - How to declare, initialize and access - CodinGeek

    Jan 29, 2017 · In this C programming tutorial, we will discuss how to declare, initialize, access, and iterate over two-dimensional arrays and implement a program using 2D arrays.

  4. How to Declare and Initialize a 2D Array in C - Tutorial Kart

    In this tutorial, we explored different ways to declare and initialize a 2D array in C: Direct Initialization: Assigning values while declaring the array. Loop Initialization: Taking input using …

  5. C Multidimensional Arrays (2d and 3d Array) - Programiz

    Here is how you can initialize two-dimensional and three-dimensional arrays: int c[][3] = {{1, 3, 0}, {-1, 5, 9}}; int c[2][3] = {1, 3, 0, -1, 5, 9}; You can initialize a three-dimensional array in a similar …

  6. Two dimensional (2D) arrays in C programming with example

    Jul 25, 2022 · Initialization of 2D Array. There are two ways to initialize a two Dimensional arrays during declaration. int disp[2][4] = { {10, 11, 12, 13}, {14, 15, 16, 17} }; OR. int disp[2][4] = { 10, …

  7. Two Dimensional Array in C - Syntax, Declaration & Examples

    Mar 28, 2023 · How can you initialize a two-dimensional array in C? You can initialize a two-dimensional array during declaration by providing the initial values in a nested brace-enclosed …

  8. Multidimensional Arrays in C2D and 3D Arrays - GeeksforGeeks

    May 7, 2025 · In C, multidimensional arrays are the arrays that contain more than one dimensions. These arrays are useful when we need to store data in a table or matrix-like …

  9. Working with 2D Arrays in CInitialization, Reading & Displaying

    Mar 10, 2024 · 2D arrays can be initialized statically or dynamically. Static initialization involves specifying the array elements at the time of declaration, while dynamic initialization uses loops …

  10. Initialize a 2D-array at declarationtime in the C programming …

    Aug 21, 2014 · How do I initialize a 2D array with 0s when I declare it? double myArray[3][12] = ? or, if you want to avoid the gcc warning "missing braces around initializer" (the warning …

Refresh