Re: Keen to learn D

2016-09-04 Thread szymski via Digitalmars-d-learn
You should take a look at this: http://tour.dlang.io/

Re: Class member always has the same address

2016-03-20 Thread szymski via Digitalmars-d-learn
On Sunday, 20 March 2016 at 02:21:51 UTC, Mike Parker wrote: On Saturday, 19 March 2016 at 20:24:15 UTC, szymski wrote: class A { B b = new B(); } This is *default* initialization, not per instance initialization. The compiler will create one instance of B and it will become the

Class member always has the same address

2016-03-19 Thread szymski via Digitalmars-d-learn
Hello! I'm having a big problem with class members. I'm kinda new to D, so this may be my fault, but look at the following code: import std.stdio; class B { int variable; } class A { B b = new B(); } void main() { // Create 10 instances of A foreach(i; 0