Structs and Classes

Mars - at -.-
Tue Jan 31 02:45:44 PST 2012


Hello everybody.
I couldn't really think of a good title for this. It's just a 
little question, about this example code:
http://pastie.org/private/4xqtze47dlx9fy9pn53sq

Apperantly I get a copy of Bar, when I call bar(), and it doesn't 
modify the actual variable of the object. But if I define Bar as 
a class, it works as expected (by silly me). Why is that? And if 
I want to use a struct for this, is the passing around of a 
pointer (like in the example) correct?

Mars


More information about the Digitalmars-d-learn mailing list