The program still prints a word copying which indicates that the copy constructor is activated. Where is the constructor called then ? Why the function does not return a reference of o1 so that modifying the value of res will also changing the value of o1 ?
I encountered an interesting case where pass-by-reference does not appear to work in VB.NET. I've supplied some sample code below for you all to play with. Can anyone explain this phenomenon. Is this intended, or a bug with the language/compiler?
the above code will give no error/warnings. But why is the same not applicable for the below mentioned code?