Stanislav, Ali, Mike -- Thank you all for your thoughtful and
helpful replies to my queries. Apologies that it has taken this
long to reply to you. I still haven't been able to find time to
go through all of the code examples provided but hope to do so
later this week. If I have additional
On Friday, 19 October 2018 at 02:04:37 UTC, Samir wrote:
I would have thought that since this is a dynamic array, I
don't need to pre-assign its length.
Thanks
Just to expand on the previous answers, a dynamic array
declaration with no initializer is an empty array:
int[] arr;
On 10/18/2018 07:04 PM, Samir wrote:
> myArray.length = noValues; // I get a run-time error if I comment
> this out
It's because the expression that reads the elements below is readf,
which reads on top of an existing element.
> while (i < noValues) {
> write("enter value
On Friday, 19 October 2018 at 02:04:37 UTC, Samir wrote:
I am working my way through the exercises in the "Programming
in D" tutorial (http://ddili.org/ders/d.en/arrays.html). Why
is the line assigning the length of the dynamic array required?
[...]
Without the line:
myArray.length =
I am working my way through the exercises in the "Programming in
D" tutorial (http://ddili.org/ders/d.en/arrays.html). Why is the
line assigning the length of the dynamic array required?
/*
Write a program that asks the user how many values will be
entered and then
reads all of them. Have