digitalmars.D.bugs - Struct toString() & this pointer question
Hey guys, having the following code: The output was: Builded a new instance at 910FE0 ((S *)={this=910FE0,m=1234}) Builded a new instance at 910FE0 ((S *)={this=13FEEC,m=1234}) Builded a new instance at 910FE0 ((S *)={this=910FE0,m=1234}) I wonder why is that in the second line, toString is printing an alternative this pointer? Regards, -- Tom;
Apr 08 2007
Structs are pass by value. The *s pushes the struct onto the stack and then the toString function is called on that struct.
Apr 08 2007
Stupid me... of course, thanks! BCS escribió:Structs are pass by value. The *s pushes the struct onto the stack and then the toString function is called on that struct.
Apr 08 2007