ubyte[5] a = 0xAA; // Fine. Five 0xAA bytes. auto a2 = new ubyte[5]; // Fine. Five 0 bytes.Now, let's say, I want to allocate an array of a size, derived at run time, and initialize it to some non-zero value at the same time. What would be the shortest way of doing it?
Shortest way to allocate an array and initialize it with a specific value.
Adel Mamin via Digitalmars-d-learn Wed, 10 Jun 2015 13:26:12 -0700
- Shortest way to allocate an a... Adel Mamin via Digitalmars-d-learn
- Re: Shortest way to allo... Low Functioning via Digitalmars-d-learn
- Re: Shortest way to allo... Michael Coulombe via Digitalmars-d-learn
- Re: Shortest way to allo... Ali Çehreli via Digitalmars-d-learn
- Re: Shortest way to ... via Digitalmars-d-learn
- Re: Shortest way... via Digitalmars-d-learn
- Re: Shortest way... weaselcat via Digitalmars-d-learn
- Re: Shortest way to allo... Daniel Kozák via Digitalmars-d-learn
- Re: Shortest way to allo... via Digitalmars-d-learn
- Re: Shortest way to ... Daniel Kozák via Digitalmars-d-learn
- Re: Shortest way to ... Steven Schveighoffer via Digitalmars-d-learn