About 2,230,000 results
Open links in new tab
  1. Pass Array to Functions in C - GeeksforGeeks

    Mar 7, 2025 · Passing an array to a function allows the function to directly access and modify the original array. In this article, we will learn how to pass arrays to functions in C. In C, arrays are always passed to function as pointers.

  2. Passing an array as an argument to a function in C

    Jul 4, 2011 · An array in a function call will be passed to the function as a pointer, which is analogous to passing the array by reference. EDIT: There are three such special cases where an array does not decay to a pointer to it's first element:

  3. Pass arrays to a function in C - Programiz

    In this tutorial, you'll learn to pass arrays (both one-dimensional and two-dimensional arrays) to a function in C programming with the help of examples.

  4. Passing Arrays to Functions in C - Online Tutorials Library

    If you want to pass an array to a function, you can use either call by value or call by reference method. In call by value method, the argument to the function should be an initialized array, or an array of fixed size equal to the size of the array to be passed.

  5. c - How to pass the address of an array to a function? - Stack Overflow

    Jul 4, 2016 · To explicitly state this: Its is not possible to "pass an array" in C. All one can do is pass the address of its 1st element by just doing me(x) (where the array x decays the address of its 1st element) or pass the array's address by doing me(&x).

  6. C pass int array pointer as parameter into a function

    Dec 14, 2014 · You pass a pointer to an array of 10 int *, but func expects an int** (which is expected to be a pointer to the first element of an array of (10, presumably) int*s). How to fix it depends on what func does.

  7. Passing Arrays as Function Arguments in C - W3schools

    Passing Arrays as Function Arguments. In C, we can pass arrays to functions in different ways. Let's look at each method one by one. 1. Pass Array with Call by Value Method. In C, when we pass an array to a function, we're actually passing the address of the first element of the array.

  8. Passing array to function in C programming with example

    Sep 24, 2017 · In this guide, we will learn how to pass the array to a function using call by value and call by reference methods. To understand this guide, you should have the knowledge of following C Programming topics: C – Array; Function call by value in C; Function call by reference in C; Passing array to function using call by value method

  9. How to Pass an Array to a Function in C - Tutorial Kart

    In this tutorial, we explored different ways to pass arrays to functions in C: Passing a 1D array to print its elements. Modifying an array inside a function. Passing a 2D array to a function. Understanding how to pass arrays to functions helps in creating reusable and efficient code.

  10. How to Pass Array to Function in C? With Examples

    Apr 3, 2025 · Learn how to pass an array to a function in C with examples, output, and explanations to improve your coding skills. Read now!

  11. Some results have been removed
Refresh