About 50 results
Open links in new tab
  1. Passing Arrays to Function in C++ - Stack Overflow

    See also: Passing an array as an argument to a function in C and How to pass a multidimensional array to a function in C and C++

  2. c++ - Passing an array by reference - Stack Overflow

    Nov 8, 2017 · It's just the required syntax: void Func(int (&myArray)[100]) ^ Pass array of 100 int by reference the parameters name is myArray; void Func(int* myArray) ^ Pass an array. Array …

  3. C++ passing an array pointer as a function argument

    Aug 6, 2012 · When you pass an array as a parameter to a function it decays to a pointer to the first element of the array. So there is normally never a need to pass a pointer to an array.

  4. Passing a 2D array to a C++ function - Stack Overflow

    Jan 7, 2012 · The accepted answer shows only 2 techniques [its (2) and (3) are the same] but there're 4 unique ways of passing a 2D array to a function.

  5. Passing an array as a function parameter in C++ - Stack Overflow

    Jun 7, 2014 · In general when working with C or low-level C++, you might consider retraining your brain to never consider writing array parameters to a function, because the C compiler will …

  6. Passing array of structures to function c++ - Stack Overflow

    Apr 6, 2017 · When you pass an array as an argument to a function, the array decays to a pointer to the first element of the array. So, when inside your function you use [] to access the …

  7. C++ how to pass string array in function and assign to a variable?

    Apr 1, 2018 · C arrays don't work like this. When you pass it to a function, you're just passing a pointer to the first element around. The function declaration is the exact same as void …

  8. passing an array as a const argument of a method in C++

    Mar 24, 2015 · I would like to be able to pass a const array argument to a method in C++. I know that when you pass an array to method it is the same than passing a pointer to the first item of …

  9. C++ pass an array by reference - Stack Overflow

    Apr 4, 2012 · No it doesn't, and since you can only pass an array of 10 elements, you don't need further information about the size. (And once again, you cannot pass an array to void foo( …

  10. Proper way to pass dynamic arrays to other functions

    Oct 22, 2012 · In C++, an array cannot be passed by value, so if you want to mimic this behaviour, you have to pass a const int* or a const int[] as parameters. That way, even if the …

Refresh