Open links in new tab
  1. c++ - Return array in a function - Stack Overflow

    Aug 13, 2010 · However, you can return a pointer to an array by specifying the array's name without an index. If you want to return a single-dimension array from a function, you would have to declare a …

  2. c - How do I correctly return an array from a function? - Stack Overflow

    In C a function can only return one element, so to return an array you must return a pointer which can contain the address of the first element of that array. And that's what you're doing in your code.

  3. Returning an array using C - Stack Overflow

    Is the return array a known size as indicated in your code sample? The only other gotcha I see besides the stack issues mentioned in answers is that if your return array is an indeterminate size, given the …

  4. c - How to return an array from a function with pointers - Stack Overflow

    Jan 9, 2015 · 4 i'm trying to figure out how to return an array from a function in the main (). I'm using C language. Here is my code.

  5. c - how to return a string array from a function - Stack Overflow

    A string array in C can be used either with char** or with char*[]. However, you cannot return values stored on the stack, as in your function. If you want to return the string array, you have to reserve it …

  6. How to make an array return type from C function?

    Jan 13, 2013 · If you want to return a single-dimension array from a function, you would have to declare a function returning a pointer. C does not advocate to return the address of a local variable to outside …

  7. How to return an array from a function in C? - Stack Overflow

    Oct 6, 2016 · C programming does not allow to return an entire array as an argument to a function. However, you can return a pointer to an array by specifying the array's name without an index.

  8. c - Return integer array from function - Stack Overflow

    1 If you are passing array - a pointer of int, you don't need to return a changed array. The array that you passed will get changed. As @unwind suggested, you should pass number of elements to the …

  9. c++ - How to return an array from a function? - Stack Overflow

    Functions shall not have a return type of type array or function [...] Most commonly chosen alternatives are to return a value of class type where that class contains an array, e.g.

  10. How to return an array literal in C# - Stack Overflow

    It's also worth nothing that C# doesn't actually have array literals, but an array initialization syntax - to which the accepted answer refers. Literals are special in that they can be directly serialized, and can …