Re: How array concatenation works... internally

2018-04-23 Thread Dnewbie via Digitalmars-d-learn
On Monday, 23 April 2018 at 23:27:17 UTC, Steven Schveighoffer wrote: ... If you want to know more about the array runtime, I suggest this article: https://dlang.org/articles/d-array-article.html ... Thanks for replying and this article is what I was looking for.

Re: How array concatenation works... internally

2018-04-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/23/18 7:15 PM, Dnewbie wrote: Hi, I'd like to understand how array concatenation works internally, like the example below: //DMD64 D Compiler 2.072.2 import std.stdio; void main(){     string[] arr;     arr.length = 2;     arr[0] = "Hello";     arr[1] = "

Re: How array concatenation works... internally

2018-04-23 Thread Dnewbie via Digitalmars-d-learn
On Monday, 23 April 2018 at 23:15:13 UTC, Dnewbie wrote: It's related to memcpy? By the way... It's related to realloc and memcpy?

How array concatenation works... internally

2018-04-23 Thread Dnewbie via Digitalmars-d-learn
Hi, I'd like to understand how array concatenation works internally, like the example below: //DMD64 D Compiler 2.072.2 import std.stdio; void main(){ string[] arr; arr.length = 2; arr[0] = "Hello"; arr[1] = "World"; writeln(arr.length); arr