About 14,000,000 results
Open links in new tab
  1. How to create an array containing 1...N - Stack Overflow

    We'll use that fact later. Array.apply(null, [undefined, undefined, undefined]) is equivalent to Array(undefined, undefined, undefined), which produces a three-element array and assigns …

  2. What's the simplest way to print a Java array? - Stack Overflow

    Yes ! this is to be mention that converting an array to an object array OR to use the Object's array is costly and may slow the execution. it happens by the nature of java called autoboxing.

  3. How do I declare and initialize an array in Java? - Stack Overflow

    Jul 29, 2009 · The third way of initializing is useful when you declare an array first and then initialize it, pass an array as a function argument, or return an array. The explicit type is required.

  4. All possible array initialization syntaxes - Stack Overflow

    What are all the array initialization syntaxes that are possible with C#?

  5. Array versus List<T>: When to use which? - Stack Overflow

    Jan 12, 2009 · 3 Most of the times, using a List would suffice. A List uses an internal array to handle its data, and automatically resizes the array when adding more elements to the List …

  6. How do I determine the size of my array in C? - Stack Overflow

    Sep 1, 2008 · An array sent as a parameter to a function is treated as a pointer, so sizeof will return the pointer's size, instead of the array's. Thus, inside functions this method does not …

  7. Adding values to a C# array - Stack Overflow

    Oct 15, 2008 · A real array is a fixed block of contiguous memory. There are some nice optimizations you can do when you know you have a real array, but what PHP actually gives …

  8. How do I declare an array in Python? - Stack Overflow

    Aug 23, 2022 · The array structure has stricter rules than a list or np.array, and this can reduce errors and make debugging easier, especially when working with numerical data.

  9. Check if an element is present in an array [duplicate]

    Of course, if your array is sorted you could do a binary-search instead. Or if each value in the array is always unique you could use a map-based approach instead.

  10. How to add a string to a string [] array? There's no .Add function

    Array.Resize is the proper way to resize an array. If you add a comment before the code snippet saying it's rarely the best way to handle situations where the array represents a resizable …