About 386,000 results
Open links in new tab
  1. How do I declare an array of undefined or no initial size?

    An array in C is just a sequence of values in adjacent memory. array[1] is just next to array[0]. So when we allocate a big block of memory and want to use it as an array, we need an easy way …

  2. Declaring and initializing arrays in C - Stack Overflow

    Is there a way to declare first and then initialize an array in C? So far I have been initializing an array like this: int myArray[SIZE] = {1,2,3,4....}; But I need to do something like this int

  3. How do I create an array of strings in C? - Stack Overflow

    Jul 7, 2009 · There are several ways to create an array of strings in C. If all the strings are going to be the same length (or at least have the same maximum length), you simply declare a 2-d …

  4. How do you make an array of structs in C? - Stack Overflow

    May 6, 2012 · 28 Another way of initializing an array of structs is to initialize the array members explicitly. This approach is useful and simple if there aren't too many struct and array …

  5. c - How can I initialize all members of an array to the same value ...

    memset for an int array only works for very specific values, namely 128 multiples of 0x01010101 and their complements, Setting to -1 does initialize all elements of the array to -1 on machines …

  6. All possible array initialization syntaxes - Stack Overflow

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

  7. How to create an array of arrays in C - Stack Overflow

    Jan 3, 2023 · If you use dynamic memory allocation then you should allocate an array of pointers, then for each pointer, allocate another array (of the type you need) and assign the pointer to …

  8. How to declare an array of objects in C# - Stack Overflow

    0 The reason this is happening is because initializing an array does not initialize each element in that array. You need to first set and then it will work.

  9. c - How can I use an array of function pointers? - Stack Overflow

    Note: here in the array the numbering of the function pointers will be starting from 0 same as in general arrays. So in above example fun1 can be called if option=0, fun2 can be called if …

  10. Creating an array of int arrays in C? - Stack Overflow

    Mar 9, 2011 · EDIT 1 Please note that although I've showed by my example an array_of_arrays of length 3 I'm actually looking to create something that could contain a variable length of arrays.