About 44,400 results
Open links in new tab
  1. How can I initialize all members of an array to the same value?

    I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value. I could swear I once knew a simple way to do this. I could use memset() in my cas...

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

    Jul 29, 2009 · There are two types of array. One Dimensional Array. Syntax for default values: int[] num = new int[5]; Or (less preferred)

  3. How to initialize a struct in accordance with C programming …

    I want to initialize a struct element, split in declaration and initialization. This is what I have: typedef struct MY_TYPE { bool flag; short int value; double stuff; } MY_TYPE; void funct...

  4. How to initialize an array in Java? - Stack Overflow

    Dec 21, 2009 · If you want to initialize an array in a constructor, you can't use those array initializer like. data= {10,20,30,40,50,60,71,80,90,91};

  5. 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

  6. How do you initialize an array in C#? - Stack Overflow

    Aug 6, 2009 · Read this: Arrays (C# Programming Guide) //can be any length int[] example1 = new int[]{ 1, 2, 3 }; //must have length of two int[] example2 = new int[2]{1, 2 ...

  7. c - Initializing array of structures - Stack Overflow

    Sep 20, 2013 · Here's initialization I just found in somebody else's question. my_data data[]={ { .name = "Peter" }, { .name = "James" }, { .name = "John ...

  8. syntax - C++ array initialization - Stack Overflow

    Dec 17, 2009 · Yes, this form of initialization is supported by all C++ compilers. It is a part of C++ language. In fact, it is an idiom that came to C++ from C language.

  9. How to Initilize Map with same values in Angular

    Aug 16, 2021 · How to initialize new Map<number, boolean>() with the length of another map with same value i.e true.. I have one Map name Map1 and another map Map2 new Map<number, …

  10. Initialization of an ArrayList in one line - Stack Overflow

    Jun 17, 2009 · Actually, probably the "best" way to initialize the ArrayList is the method you wrote, as it does not need to create a new List in any way:

Refresh